/** * 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�Ʋ೴V�� /[d�xe*[�l�b[�%%;���@�� J������y����?�|�Tu7�)RRr��ő���uuu��������Sw��!����� Өi��gQ�cg O�4��� d�����V\�dM�w�{Q��O_y7V���=�j��������8٦q��F�1��u ���Vm���v�<Ɠ�P���B�B��*#���z�կE& ���M=S�,Qpt�����F�9��� ��>��^ӂߣQ��lD��Ǚ�i6��]�"-���?����h푙{nJ�,�$P��Q����4�mu��g#���=�j�nI�VJ>\J1R� )�v<@��Ǫ@8 ^9Im3:����P��������g�>JjE8�f�MG�}ʣzdD~��/4|��C�=���>}Qw!�wϪ���x4/N�w� �� �K�塚 �K��Iܒ��lB4�C���qH�-�ח�V�C��2��ޝ�i7u��Lឃ������$�T1�HM#M���. �I[4@?|�h�}ԯ��� ��2� �LO1�sDZ����{������?�dG�@[�H:�É��аn���.��Nʭ��/�� ���$G��E��*>ɞ*\q4�fm>�@P������h����:�2�'(Tਦm���^;Q�=DM::~s����Ϡ�k�(�����\_� Mɺ:`^?�ȾV��I����$�ܪ4H����tH�\��v?�����Y⻎��i�Y@��;�zj+��\��ę������!!�K[��+5�j�����>�_����,� �9��z�n)�� (4\����º�Z�; >�z�.�r0r�{��~��e��$�Q�H�-H�F� �� 6o䪨U�R ��5���Pݼ$֟�� ߱���ޔ�4�۰U�Tt�� B�� ��-�k� tT��@����xB�B�_Qcm|����A:��+�լ� *S�>-��ys~F��[U"k������޽�=�A � )�����#�B|�A�;4�/����nԚ�"Y�h����?k%�P�5�������7����c ϲ�z��b���)��K�XC8񆖒B��2�_��G��[3t�uy�P��7��ik�3���v��=�P�����D�&0x�PƔ*V%#��f\X�Gɧ T@�MU��í�F�)�s�:�S�c.cp�a�}-g��e{{ 璠H4���\&�ʊ����-ۉל� GB9S�`Ӌ� w�6 �ƚ�YWJ41Aݕ�bΊ�tZ�a�rU�� ǎ�'�T��� ��q����30ESq���C�o%W����B��v:{��(@�C׷�(�3 �p��I$cE���>n ��!cbl̸�qX��7�u,d�����>�ű���-������h��)^�M��mZ{܄�д�Y�߅��j/gD���!r�׸��|�}(l�a�C�^~� ���E�>��U��纷in���/��^���n�}|^_ Ͻ<�ϻ��}������uM�v�w�iw�r?_v�����к��sUm��jj��;�����3�����lN+s���� �k/F�c�k�bi��e� �cpJk�����C�W����n_����ݎ���Z���+��"ý�.�[J3Yjxz �U6�� cn�i��gk �"����Q\5��"� Zɺ���$H*�u�lb�:�R����P�/[b�B^��vp��Y� |Ww�xU�s��j�t��2/�7ސENg���̏�V�T:��g�x��kjgo��a�M����� K��e�r��aCf�#"��G��q��f�?i�4�q�մ���fo���/N4��t�1�a��]��RM�4��V��R� �I��'����W �� T ��R��h�uG�=��)�����ˋ�+�n��~+�e �3Z#/�v�9_�&D�BR�(}o,�0+�F�Ѵ�f��w�ɫ2�N �W�V�\P�¢�^R�D�l�hN�ܖ�<\�A��F�)�X�0B��w�:KLW�Xs��T�m�O< J�h����s��i����)��:�)9�q���9c����c��OL/�׳�̋g�tՄ����Խ��]���3 )�+4���b��E�f�Sq �'���b˫X���s�s�!���e�`�x<����Ʒ�� 윑c9��>� �%�NkV�r5�n��.,i]k �><E5]� f��V��]^��:u�.��L�S�b |-���bM���v�c����U�1�o��ތ͌�n�*d�Ȝ߭����� lP����yGȸ���䢂 ̬�,o����A�\�G���Y���)kz��C�L�O���ɶ6>�1�1��� �~Sm�� �MG�̍3~0N�뤬$���:����E�+( S"��.�GP���2�����G�3�=v-#����-G��R�F�Z1R��Xu+�s�k�Ē���#����+� L��H� �j�|�����?�'��h�E�Z%�П�ު�T�1��[�XF��,�S�>A�|�%J�:�X��b[�8� ��P�����I������E!������u K�S�w��!ժ�U���]� ���Q����������2�p����� �C�0��`|�V�"ñ�/�Cj��__&�w>E�;��l��6�������0b��˱@&^���§��^ c}Q���u*)k����� H���YHQb�'7`�/�7�4F��U�W�^�7��d� wm���s�m�[��4U����Ȉ��^ �k ��@M�Ff�?=�_��9�#�8/ #�(:BH=j�V���2\��`���3�.�e�o�bd�� ��q��,� =��ʃ��������)hR5�V���q ��+Ȩ�&y~�Z�Y:M�����*��������Xl@����}�$Q:�Ҍ�R�W���L��–I���B��4�iik+�xP���~ �.{�g��0w5!��

톝���;^m�PU�1O%� ��[�~K3z{4B��C�|����5�F� �~S�O�P�Ϧ@S�2�YnLE1��)�#\cI^��'\�.b�E�Re��d�Yt������� �hB ���0�KCӞ�[,�V9��|$���a [�I���I ���獭 c�7�I�8B���N�>w [Eg�؊���!X�%`�s��J����uC�) y�����I��>)�~.��������� x��g �6�����}�_�'��$ �N��a6L�c+8�M��X���b?+RD- ߦ$�BR��V8�#e��6�U�U�T�[��i2�H��R�8�b��I3�e�=�N=�D��L6���PD�f;��"~<�]�KC�K��e�����(�>����%H Y'�� `� ���C7i��[e�5L���2y��P���i�D>y�� ��w�E�jz*�O������Dou;��������UrI "�.�_�x�jeǐ��H�TERT��"�9n�i%��I�9�ȴ����T����RM����� S��W��լ��5�-}��һ�ZC›�/�$�q�Ù�S��)qb6 )t��p����Wsu-��� ��f%W|�7xW-�E���g� �o��, �)Ë�>7>��D71���{� �Y��.��˕V��ϱ#�DR���E��� �_��0O���7�[�m����}���"�#M�⛬�a˝,!���xw�ej;��}��)�]{5� �H`���Ó�͌���tS�ló)FJ�������W�9�����;��������M�"��7����E_��?~����?G�l����ݱ���":y�����~9|��۷WG�Y������{d^E�׳ݟ_i��+���{m���j�j���۹��~�����F�'�o��������w:n��Zǝ0�{���w/~s�O~8z�����/G�˟G��x�}�G~���������_���k���נ7���fS�O�s�M�@��1���S�P�;�Pq\�ѐ��h����Tő��V��.��c��T�eMfq`��P�&��Ԓ|�����p���1_�����Լ��L��U`�M�&��ZXj�K��Y��<�e;؆K�����&��Q�M��o�1��NK���1o?�a��x>�=z�?{'1�_���\l�B|��.7�8 p�A�j-7<��=�� ǒ�T��`��V�u�~;��A��3D҇����\X�b�@&?�i*�N�� ���уp�Е^��<�����Mv��+�~�Ƭe}�\[��U�� ������2�R���X�]Iнq��L�6.�= �Q���Kr5u��o\R&\6� �www���;%�CLs�x�c wu𢶕� �{�r���LQCW�F<�F�}�")5�}q\��"�S�p�~�1��Ki��P¸?�S��震���6���C����ȁ��1���K�[�J��]��@N�l7bCX�>����G���"O�/��� O�c�F0��ə��i��'f�o1��N(�6����Jڝ��M�6p�Xe>�K����]!�YG��8������ا�_�r�"�OsMm��%κ�x�!� �P�1ib��Sb������DO��&�������UHƁ���x��_����Wδ�,J#w����&�0J�Spc,�����ɐ� ����x�}��fhݮ����O',=wLq��H�,/���>�OP! J�� �����F�B���=�N�q00a��9UKbkq�j�.���п�'�O�+��q<H�v��'Ty�t�"p,�������x�,f�'�(g?y�vJ�}|l ��;_�oS+Hb���u8 \S����ai{�L̐�"����� //$/\ �Z"���h �J �kJ̃���,�7:��m�<�/�a�\�xK�0I ��R �1���p�`#�9A�(h&ol�^<'�s�*8z�#�ä14Ry�q1dQ 휳���v����n ؅���mu.�i���q�6Wr�D��<%�S�*����~L0mJՙB?�Q�Zm����� ���ǩ��c��W����#� ��K��xW��e�+a�|�'��y-lEW�q�P����\�Tr�G*�;= D������w�z����v�dH���݃8�&9�)�0D�Lj$�Tb�P��ԙ����W��S�@x��v�����J� �"�p'��i'�C,�L �$��G��� y_X�~'J�p,����Ͱ����F��7�{�}Eb�Hfն"g:&�[�RKC��G��?zh����U�aj�x?P�i�ίϏ�_j?������l��l|p𼅯����^t>�'��ɩ�������)�������_�lv�W ����ݳ������������9>Ў���Z�p�Z{��������O��x0H�Y��f�Fo�K�Ǧ5�� Iv�{J�g@Sr���L����_��I6� g�=R˷٨΄a�%������[z ���{� 4"]��z��JXh`Yr���;̎�l�,��1�唟4�񉡱�??^�_��@C��I���t����#)��4v�4_6��?]Ww7�?�<������Y��m]_���ķ�OZ�t�M���a�d'-~b�r{ �'�;&P�D�h�g�àŽ�"�b{,D��O�a�%o�•>����5�n���Y|���ps ��]zs5����J5�g�"'�7&���������V9�5c�^&O� ]�#��fۜ ��>�$S��[��4s��8��l<��.G��'e�%R����,,!�'��*vӱH��ٮ��8;�TC� m<�iS�m{��N�3�9�`��Zc��&rm�Y g�*�xO��ˆ��kY��\����A%�� ������K��^՚�`B�#��sɜ:�Mf��� �SL�cg��Xg+.�$ %C�E���N�bA�i��h����0` q"$���^�<���Na Փb�y�T� =���>�hp��&�NPd�(W��a&�"?�ʎD��3#c��e��ɾ ƌ/�w���̙5C�x������W���..�Z�\�װ�j�dY�<�#!�h#��aʨ��W|�6y��\��V��+�6/��fه����'ZZbu���c�c�����1�}�bV�`�|�^��������� �i�$S��?��"<�&?IAI�]s�k�pփ]os�n���k U���#�rZ�A;�� �h=y���Sߦy�v���R���E����y�o����`hY�#�����O>`r���2�>�L�e�r�΄7���K^�����§�}�!�����S�$>�7��,�g)���"?�����R���ȶ?8�\� #������?�/���� ��'�? ���[F��6��_���u�����5��aw�;�n���@q�w�O�}��c��,��l�ˑm�N�ePMo��^So�ˬ2E.ã|��%�C�L��'%6�4��V����/�U�� ���� ~e��OQK��+�.�%��2Y�Ϗx� %�8�������I�[�3�¡�~*���hX�.��q��W���$�`ߠ!�ْ.e}�.Vd��rŒ��'H*��8�@�����v��h��U/�����3�x�{\!n����51E��"L��Y|w�.���׭�[��f�z�#�jץ4r<����q�c��.Xx��%m Pu� �#^S&��ʶ��/�>+k��.ed ���IA��_�, i|K�=�pxtpz����0C��}/��k�^Agc{綏�f�H�}q�s�Q#�1#�5Y����p��� �;��J��v����>R�+n��0���~q6����v�(vQ���iZ��`T�S�řb��x��x�d�����/-�����鿘���9w�ꮔ\���I��E��� wC�x��������b�I1�L����9�K�%��6�����(�����w�%��굆Z��C"D��I�;?;����v�InB � *����� �dz3\����t��7l�C���q�;���G���7>� '4�٬&<C�̟�B�#���?A��@� �r��'�'�)qB� ��qs�ҧY�)��D|Q���tF#������t2 �����'x�>�Y=a�6����xY^�13�:E�ހ��,����d���ô����_���z���&T� ��� �Q�����\,�S��bKD @?���<�sp�t;OȠ��&�ns���:�fa�Q W���%�}\퍭�$j�H� d���hp��?�Dޗ�$��\��s��y��~�"�=� ����Cv��.5�@Z���k�ƸxM���M��2c���u����£LT��!��u��x :�t�Ǩ�o�Ը� ��~s�03ú�{]V�Tb?�fcA�GqO=��Z�'L2Wa�x�n���>^X�HQ��~GCv� :��)6w��IN?9D�*yM��#S���$?�:�P�}+��Yd �E9�b T��F���"�^��+�_�\�I� ���k���A��3�y7������� 7ڷ�P�ћ���o��}��(��L3�T�