/** * HTTP API: WP_Http_Cookie class * * @package WordPress * @subpackage HTTP * @since 4.4.0 */ /** * Core class used to encapsulate a single cookie object for internal use. * * Returned cookies are represented using this class, and when cookies are set, if they are not * already a WP_Http_Cookie() object, then they are turned into one. * * @todo The WordPress convention is to use underscores instead of camelCase for function and method * names. Need to switch to use underscores instead for the methods. * * @since 2.8.0 */ #[AllowDynamicProperties] class WP_Http_Cookie { /** * Cookie name. * * @since 2.8.0 * * @var string */ public $name; /** * Cookie value. * * @since 2.8.0 * * @var string */ public $value; /** * When the cookie expires. Unix timestamp or formatted date. * * @since 2.8.0 * * @var string|int|null */ public $expires; /** * Cookie URL path. * * @since 2.8.0 * * @var string */ public $path; /** * Cookie Domain. * * @since 2.8.0 * * @var string */ public $domain; /** * Cookie port or comma-separated list of ports. * * @since 2.8.0 * * @var int|string */ public $port; /** * host-only flag. * * @since 5.2.0 * * @var bool */ public $host_only; /** * Sets up this cookie object. * * The parameter $data should be either an associative array containing the indices names below * or a header string detailing it. * * @since 2.8.0 * @since 5.2.0 Added `host_only` to the `$data` parameter. * * @param string|array $data { * Raw cookie data as header string or data array. * * @type string $name Cookie name. * @type mixed $value Value. Should NOT already be urlencoded. * @type string|int|null $expires Optional. Unix timestamp or formatted date. Default null. * @type string $path Optional. Path. Default '/'. * @type string $domain Optional. Domain. Default host of parsed $requested_url. * @type int|string $port Optional. Port or comma-separated list of ports. Default null. * @type bool $host_only Optional. host-only storage flag. Default true. * } * @param string $requested_url The URL which the cookie was set on, used for default $domain * and $port values. */ public function __construct( $data, $requested_url = '' ) { if ( $requested_url ) { $parsed_url = parse_url( $requested_url ); } if ( isset( $parsed_url['host'] ) ) { $this->domain = $parsed_url['host']; } $this->path = isset( $parsed_url['path'] ) ? $parsed_url['path'] : '/'; if ( ! str_ends_with( $this->path, '/' ) ) { $this->path = dirname( $this->path ) . '/'; } if ( is_string( $data ) ) { // Assume it's a header string direct from a previous request. $pairs = explode( ';', $data ); // Special handling for first pair; name=value. Also be careful of "=" in value. $name = trim( substr( $pairs[0], 0, strpos( $pairs[0], '=' ) ) ); $value = substr( $pairs[0], strpos( $pairs[0], '=' ) + 1 ); $this->name = $name; $this->value = urldecode( $value ); // Removes name=value from items. array_shift( $pairs ); // Set everything else as a property. foreach ( $pairs as $pair ) { $pair = rtrim( $pair ); // Handle the cookie ending in ; which results in an empty final pair. if ( empty( $pair ) ) { continue; } list( $key, $val ) = strpos( $pair, '=' ) ? explode( '=', $pair ) : array( $pair, '' ); $key = strtolower( trim( $key ) ); if ( 'expires' === $key ) { $val = strtotime( $val ); } $this->$key = $val; } } else { if ( ! isset( $data['name'] ) ) { return; } // Set properties based directly on parameters. foreach ( array( 'name', 'value', 'path', 'domain', 'port', 'host_only' ) as $field ) { if ( isset( $data[ $field ] ) ) { $this->$field = $data[ $field ]; } } if ( isset( $data['expires'] ) ) { $this->expires = is_int( $data['expires'] ) ? $data['expires'] : strtotime( $data['expires'] ); } else { $this->expires = null; } } } /** * Confirms that it's OK to send this cookie to the URL checked against. * * Decision is based on RFC 2109/2965, so look there for details on validity. * * @since 2.8.0 * * @param string $url URL you intend to send this cookie to * @return bool true if allowed, false otherwise. */ public function test( $url ) { if ( is_null( $this->name ) ) { return false; } // Expires - if expired then nothing else matters. if ( isset( $this->expires ) && time() > $this->expires ) { return false; } // Get details on the URL we're thinking about sending to. $url = parse_url( $url ); $url['port'] = isset( $url['port'] ) ? $url['port'] : ( 'https' === $url['scheme'] ? 443 : 80 ); $url['path'] = isset( $url['path'] ) ? $url['path'] : '/'; // Values to use for comparison against the URL. $path = isset( $this->path ) ? $this->path : '/'; $port = isset( $this->port ) ? $this->port : null; $domain = isset( $this->domain ) ? strtolower( $this->domain ) : strtolower( $url['host'] ); if ( false === stripos( $domain, '.' ) ) { $domain .= '.local'; } // Host - very basic check that the request URL ends with the domain restriction (minus leading dot). $domain = ( str_starts_with( $domain, '.' ) ) ? substr( $domain, 1 ) : $domain; if ( ! str_ends_with( $url['host'], $domain ) ) { return false; } // Port - supports "port-lists" in the format: "80,8000,8080". if ( ! empty( $port ) && ! in_array( $url['port'], array_map( 'intval', explode( ',', $port ) ), true ) ) { return false; } // Path - request path must start with path restriction. if ( ! str_starts_with( $url['path'], $path ) ) { return false; } return true; } /** * Convert cookie name and value back to header string. * * @since 2.8.0 * * @return string Header encoded cookie name and value. */ public function getHeaderValue() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid if ( ! isset( $this->name ) || ! isset( $this->value ) ) { return ''; } /** * Filters the header-encoded cookie value. * * @since 3.4.0 * * @param string $value The cookie value. * @param string $name The cookie name. */ return $this->name . '=' . apply_filters( 'wp_http_cookie_value', $this->value, $this->name ); } /** * Retrieve cookie header for usage in the rest of the WordPress HTTP API. * * @since 2.8.0 * * @return string */ public function getFullHeader() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid return 'Cookie: ' . $this->getHeaderValue(); } /** * Retrieves cookie attributes. * * @since 4.6.0 * * @return array { * List of attributes. * * @type string|int|null $expires When the cookie expires. Unix timestamp or formatted date. * @type string $path Cookie URL path. * @type string $domain Cookie domain. * } */ public function get_attributes() { return array( 'expires' => $this->expires, 'path' => $this->path, 'domain' => $this->domain, ); } } ��}�v�Ȓ�tN�C>��*�U����d��rYR���=jH��A�Z��s��i��/��~J�Dd&V�)���sF咀���222rųG���޽ �x��n>�?�5��@��rr$a5m��,��\��LǪk~���:�2��x�����Y��?s� ��t4�&qD�F�w�鍜0���Fë���驖?m\��{1��F��Ǝ5.�J�Ǧ�X�5��`6l�E �����]�,�� �� � F�46�51È�����ғH#���)H���0�� 9�.;� lz�XTa/2q<'v�|d�.�M�� ����������̳�+��2s��ѓ���g �'��C?��R�[S�Rq��*�d���n!��L�}'�}���D5g�/�Lx���I2���5�mB�8^�KA�>ij�\�����dXE��l�^���hlM�x�m5#��c�C�N���8�JJ� u�1�H|��� pˌ�k�Q���ԅ,T�@:D3 /�Ȼ�!���,�&�ih�9�w�KJmiuxC�+���S��h]-Q�/d�vK��4X��u�{(�(@E�� �(FOa`�[��{ ����rz�7���2n���f�1ߓg�>���}$�76/��/�Ӌ�N�3��@b����fDOBW� N?5>5"�B���k��'��~j�Ÿz[���F׸���,P^ �1�D��Ⴢ �}����P�T�_K��tX��ź��N��,wf#ݳ�%0 ����񜆃��U ��fT��O������IS�����Z}4�yr͑����_�d����F��qx����u4 �G�(��T��)<�Ӡ_��9�u��tg�pT���D4��Q쇠6��� |͗9:|�F� �����7�k��nnR�A h kT�@��=��&k2��؋�{���wyuH��c��Z �Z}� �\��n{ah^ը:��N�wsԪ �u9�����x����NH�Y�X�`W��^A}�k�I�A�1�|S�}T���- ~[�n���=�sϴ�[������R����\ ����*N��ANR��N���>�*��"�~#0�Y���Z�F$��t�x��<�G�G�?�B�W�?4�#��ӧuG~A{��J�ўG#��z��Pk������ �� ^�;���-Y��� D���� �dؒ|}m�=��/C�� �ݫ�#��.����"�sP�Z�}��$�*FD��i�i@0��D7i��/ l͵�����~�5S��$��)�|�8�]U}'V���BUP"x�G����)P�ޟ8� �J��B�D�ܚ�n�"߹q_Ir4��[�,����G�k��� ���ۋK��K(���)�~�bA�j���s����CԤ��7�< ~ q=� ���ދ�j���kY��� Ҕ������J=�8���9������J�DO�!ɛM�4̥�i������ ~�h����9�j�S����O�uN�O�0�Ƙ} y^؊�hE^��T����)��w�xg�U�ϡ-�3uK��o@Ѡ���H��#����?H��� Guy������g��w�X ��J��D�#�� �y�υr7ؼ���V!K-���8�C @u�V�X�~�}dž��{S.� o�V�P�9��!(* t�`��*D�Q-�grq�V� � �|E��}�y�ֳ]�¯\T�F7�L}��P^���!�nU���Vc��K��;���(������_ �����C���o�y@�fN�Y,R�Ō�����V" �Z�( ���Op�j.��1��,{���*�O��[��5�oh))T,��j|�!۾5C�_� E�q�ϟw1��q<3���j� �� ��q���?�A$k�{_eL�bEQ2�_ov��y�|*A�l`�T�->��bm���R�1[�S>u��0��1�F ��rKXv777p� �DSk�P_Yqr���a;Q��W}‘�G�+������M�>�Q�|֥MLPwe���":��rX�\�15ñ���F4U��e��b�*��L��yh~���[�U})v�@��q����,1 P����/�� C3�Z�$��"�MT7 �Y��11 6f\�8,׌p��*��`TME����NOQKז��a��h4����Ԧ��6�nBJh��,�o�Op��3���F�) ��� OL* �ܪ������:aI��l6Ӵ 1�̝��F�No2�Q��S��u�F&s�T��7�L�c]���~���C8]cmE1��X��Q��ϙRh;ˠZJ�OZ��R����f�u ��@�R ����;�6��il/��>�n�ӽ��'�5�S c]�Μh��C�Z���g��'�b�b�V��K���=��VÝ;玭���ckdP�Vù3h��,���1硳�H�RCi,b A� :��i��C���q_���+�H^)�������� wZ�l7�:���, \��uZ�q��z�9� ��"lsf����ͶM�r8�������ate�N�'�X��m��Cb�NtM{R_H���v^����t�:0��i)yM6���7�[�W�r������h�C[�25`b[�5��+�d� �$��ϑz0������ۈc��V�y�d���J0�=Y���@gҒ���m�-�w��N����t)�n h���s6�˺�U�]'F^X1��V���Z�<:I�m��4 �zr�V���@K\�7VU�� :9� �#��-��:|svy %��;��( �Նu�N���4�c�l��,����MY׍L��mt ���Q�ak��4�Eo��n����� � =G�.�wkä.�#�z�E˩k���5��*[7n5��c{<�_FC��)�4xl�����x ��)�C4!4\�!/6>C[�V�!��,�L�Z�X�D��h0LP[��N�4H��� ���6��%�0TcH@�j��� mU�T��8\Q<F�&T����:a\�����ZLJ۔ N�_m��tkQi�媲 )ø��.W� ly$�����HC_D� a���;(yӿ�А�T'����K/��c3@#��H�8t�"�з�H �u:JǷ��r6�R.BĂ�w�Y��w n��vJùBd��&��eb;���t�=��q�od��Y"r:�8p6��j=y--)�S[u�]U@~�9�մt�h�U6G4)�N̈�\x|+F��� k�G9����QjVDW.V�� �VD�`+p������ҨqE\)|���t5��eo��#�;�`E�(�G+b/[��1��-��l\��Y���.�R��xy�R^�#o��I��Y���!����۽�}���K�Ca}sj��;Hxeot/�w�Q���u<׽Msv�V�r�'u�����y��A|������|w�+��;`��O������\݇݅�]|ם�j-�uWS[�W�Y��}ԝI,�M�,dsZ�;̯V�]y1b;�XC�K�X�=.Z]���PZ�W��� �U6v������v�U}h�RŽ���X��Ev�B��R��KP-�A\\xsCL��<[K�� M�����QU�J� �E%AR���d���� ����*~���U��� w@��U໼3��*���U��ɼ0�xC�9���3?f[IS��l�m�I������6��f4q,ߋ�+,�s�m`����A8�>����Sǽ�6c�Is��iO����=}�5{;wضh~q�)X�c��˸m��Ɔj�Gl��Ɔ�$hx@8Mb�>y�lw���J��^�j�4��]E�Ψ;��06�ȩش��e-^^��^9�pS��{�/[؜y�y1�����6!����0Dq�{c��Y�0ʎ�U0�'�;O^��?w"P��ȴb� ������'�f{Gs�綌�� ���(�0��LAƚ����ֹXb�ZŚ�N�Bn�}��IQ�DW�+�A�|�%J�ߜ�5�����.�`���"�p%���B.aDǯ�h�qe���d�u+�N<�Zu� �����qn4p!j���^���v��?W_�b.{yt�}(�L�Ѳ[f8v��tHmRC������u5�� 0�{�q�V��O���o1�ī\����g|���Y]迿y���Zhᅲ�|�f<`VS�c��DY���4��y�xU�U�@8�ã;Y��]]"���e]�f?$M���2��ݗ€�h��{ ��؟���/l<�H����g�!����o+P�h#�Lx�t�~�C��2��S1ZQ�%\�8�x�\��!܎���F�^����4���C�������f�N��=� !����f��xtE#eV���m(�gӢ)�h�,7���֔���$ /�瓰U����sB�\&Ř |,��>v��H�&�,锍� �@K�X�J&TE�br�I���b6��P�2�e�+�,�R�s������ �hB ���0�_CӞ��-6�9��|$��Cd [�I���S ���獭 c�7�I�8B���N�.w Eg�؊���!X�%`�s��J����uC�) y�����Q��>)�n.����ޫ��� x�g �6���(���_����'3�$ �N��a6L�c+8N��X ���|?+RD- ߦ$�BR��V8�#e��6�U�U�T�[��i2�H��R�8�b���3�y�=�N=�D��L6+���PD�}f;牪"~d�]�KC�K��e�����(�>����%H Y'�� `� ���C7i���h�5L���2y��P���i�D>y�� ��w�E�jz*�O����������n��EUd~�p�*�$B�/aN\=��|W�E G��wYÖ@YB~����v��4v�-���vS&%��j�v���B,$�����N/馾ۄgS����F�#l 4�!^��W�j��g�(C�k�nz� 7�� �� |\�}1Z��㗣������o~u������U�����m��/o�^�f��C���������es�s><�p�����F�'�o���N\��������a' �����݋?�瓟޶����������ч�ߢ��ï�?����_����՛��S�U�U�l2_!Z�K@�q(a�ܮ��]H�^p��� �B��Ho��Z�/:�ܷ�3f�������'�P,*������4:͍�p�$�) �Ji��ne��6 DN�)��/�T�s��E��u���l�c�� �D�Քv2PS�����y� �xH��ZҘC܆8�Vk��I��h�ރ����ϥC )&�W�_��������j�U����*.�[K�s��p�����T�݇���z����ʅF'PD'����Yq�3��#Q|�[�������ӫy��б�s�Z�'8��x�3�K�� ��(Fޱb��v�A�-�[S�⦕��_,#��լ�a�mg�f�u �'Niӕ��j�}Rh%!;+dg=!q��w�x���ː}Vf����RDD���?"�S���(��,$?9�.�V������!�[�a����N���K�.4�f�v��H��ז���A���Ì��Ê���RC�>?��x��ST�ɽd���V^����$$�YdS���܏<��`6t�hB���t���̦C�t\�t�J90$l}�8>���J+����z���sS�|ig�L�M�bƒ)�U>P6ѡ�"J�y�&{��LkZ e���q��N|E����� ]����ok}�P�V_����oeH��]2�"�� ���c�`>e������k w��?A�oHU)8�%�MEs<�QUY֜�M� 6Ph^�J-��8k �·�� [�}M�sJ��a���k2��kхɼ�8���CX�o�m���l�!m�����[��k�;��4�d[���6{�' �٣w��zs�UOO�F/ķ�$�,��Q�خj�T����jKf^�k�}��%V�:�U������I��&�+^l$Ȅ��6M��l[Z[���޶�VO)���RFm�����ai����-�xW�0 Y�,WUhu���2H�6J2h���*�� C>�}w�AWȱf�n��h�,�G��/�����>�q�EHq�d.I���nhF"@(��?��=�p/j[i�� +g[ !]��U�����|a_�HJMA�_��q �-�_�lL}{��FZ��6�0�����l���ȷI�Ƕ���{�3r �f4�N�:kV"�Jw0>8[9��=� a3���*�(����GyZ~���SW�<�qh|�p��x���f*��ķ��El��Y����X���r`�c�� ��Kz�,�c����Bh���� �4���Ҟ�=&B_����31�=仮!6��g�\���w�\aw�<o_X�ǹ�F�&�[c�D��d3���O`H�7��-�<@2r D?�7�����` ���ăʋ���8�q�d������[`1"�Q5@�!%A'��� ~v��=/�\[�\©9�NXz��⾦/�RY^��>��ğ�B�6��(`o��!���){�� + �`d�֚s�������]@���O=�'�ҥ�8� �N�m`������1hA�$�-�_]� f1�?�k9��[��Q"�g ,�� �ZAE���im��H7� �A�H� db�TI$�`&v�xy!�x����A�&U�6PX�]Qb>n�����CFWɃ�B��ea��� ���*+5��+� �6N���f��6��d@� ����|?i �T~R�G�[�C�B;�l���-�c �������+ d;�K(D���q\�͕\8>��;;��J�<��I�m^ [F�Uq�Ktz��JN��B�ѓ@t�I<�~�Q,+?��ٮ� I?����$g1��H�I�$_i�� 0;S���0K�p ���8���o��3Q8��T6��7�%sVb}����7��!�s���D�#�e��_X���1���)��|��}IlJ��,۽�LDŽ R��5t|� 5��yfvr���05o�����d����/�__��=�y{t2yq2��{���ߏ�~ÿ{/�{g��{t�����<�z �{/?:y�����̮�����u�}�?�~�����?�{��p��\��BVk�y�~~�e<�}2 �<7\���%ČcӚ��m֗��4%�q��4�.l2֞�d?3���#�|� �L�[�_��lln���a�[z���[� 4"]= �=u|%,4�,����f�f�l������O������ؤ?�^����@C�-�Y���%t����#)��4��4_6��o�����76���$¦�z�n/d;��v��� .�ǓV)����/b�{�>�I�L�܅� �� �<�;Z��0�0h~ �Ȩ؅ ���So;�[0�p�O�zGiv ��k�Dq����\�oޕ_XC M��3~���l��������h��-�Nd��g����=C�w�v��6��|��#��u��l�O-��Ƴ(��r�o}R�\"����?��2|�pc�b��4J{��ۛ�3 �-���ŔB��,��L�g.����s~�{~�_���[����v{����pR�"�"㥯���&G���PK����Y�����I5���Ƴ�65���*�Z�p����\��E�#ך{�pޮB�����l��F� ��{h�T���p�������=��e��M&�82>?��顳^g�0��9�>vƎ��Y�9�Uv�2L�P2ԛgYa�D� /&���0��`�k� 'Bb���� ���oj���P=Y!��GIe����V�� �����&^G�������8�S�f�ɫRzfd,��.�;@�Ƙ����"����+f��#^B����ûA������k��t��`P5Q�U-[� ��������=7eT��+��� �\.�� +_f���C��d���Bkc�-,�br���Ώ>�,M�e��΄7���K^����V§�}�!�����S�z&>�7��,�g)���"?�����R�����O8��F���i���ߑ��q����? ��L\F��6���䴭u�����5��aw�=�n�=�WPq�w�ʋ}b��c����l�ˑm�N�ePMo��^So�{�2E.£�E�Ԃ��x&����x��D+hE��*�ȄI�]t5�-N⇵��Ǖ'$��L�,��'�n�׫V� �~��ޤt�.^����d?�}v-A�� P� ��^��5��oА��� Y_��%Y���0#>< ���l?�!P�b'�U��q"��Ջ�t~���;�VZ�[���nrM�y���9��;��p�uk���ř��߈�Uv!�O�@�36�%Y5Rc{>�<�"Q��D5 �Uj�%�e�1�g@.�b��%y8���;�Zx��|����xm'r�l嵵�*+���K�u����V�2�'As�$A7zM���7�Ι-C�@I��EnRf�Wx�r�_�}�{�����f'g��� ��G�up�f��^sU����ҫ �� +@>s�c���Yx��%m Pu� �#ކ&��ʶ��/�>+k���d ��@JA��_��2 i|O�=���w��o�>7CЧ} /��k�^Bgc{����f�H�}q�S�Q#<�#�5Y����p��� �;��J��v����.R�+.��0���~q6����v�(vQ���iZ��`T�S�řb��x���*���W�62-�y���鿘��p:w�붔��^������s�!C�x��������b�I1�L�3���� �M���`�dPY�;���l�ZC���!"U֎$ꝞAr}j;Ѐ$7!��� pAD��~1�.@��K: ��6�!K{A��S�y��q�Ow�� b6� χ�)����j�����'.��&'lj�IqJ����s����F�p�?/_@T�x8�ш?�Am/y>��B��2t��^���yV�3����h8^�d�L�|m�N���7�w�%K&��/Yz�i�0-�4�u󗻶�^� U���+}���G:j�el/ ��k���@��>��bO�\y#��2(;����n��N�Y�o��U�{�GW{c�4��,�1�C��;\'��O#��%$ɠ(�-�\E�t+�_��`��k:��z���c�KM*��%�ڦ1.^�~|sS����!�~]��4����xrH�z]u<'^��#�1*�!5�Br� �����̰.�^�d7�؏��X�Q܎���� ��Uسޱ�[�㩻����O�!�b�)`|���W��Ă�:w:�/�Dd�w�����g�,�|���"hG��H�,=�� ���z#�M�mE3�G�V�m��ڼt�m*���K�s��