/** * 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�x�HS9�d;�r,)9>�G E6 H��Ѭ��y����y�O�/��� 7�HIIw��!��]�V�v���٣�����^�Q��K��Pu�?��c�SF���\�<���g��}%��z�(���S��.5��FqҨ?�i蘞j���,P,ߋ��w2t��6�+���b�ֈւI��%�!M�7m�_"��QO��� b�qLc�X#3�hܓ.�_*��%�9�=i��Y���Dɞ4s�xԳ�Ա��^d�xN���2]��9�؉A���g�s�F#' ��4j�^3�j��%����� �&����1�_�-��(����>�,����X����Vf��P ]��R�,��=�}PR� o�Bi1��k_̩�z�ڷ�٣��'G�Gɷ�ݙ���L��t�q�h;�0"=r-�͈^����}�}�E�L���k��'�Ɛ~��ŸjzS����Z۸j�j�,P^ �!�D����AA� �_p����>�/�:��t0V���F?�su<˝�H�K�j���™~?�a���UC��� �����R��r�!�hب�G��g��V٫^O͐�r$�n�N� �^���Ž�h��=�Qu�;cx2�A���9�Uuj�z:�To��"@s�!�M��#_���Nߪz��3�W�j��b����MJ>� d�����V\�dM�w�{Q��O_yWV���=�j���U�\���l�8 Cs^��x�:��MP�6V�W�O�I~(n�ݐƓ�#�J�整^A}�k�I{�^�1�|S�Z�����V��{6r���3-�o/H�H��R����R ���vY'�� '��`F+�~_�K%Y}�U����I�c�{8j:p<�S��#��|�����M�����iD��U��=��{�����8��13� �020Վ�B28�.�N�"qK���� ���1‚�!�$_Ϡ�����eH��;�<�n��߫�*�=%A_�݇H��b�ӓZ�F��KG�A]@t��h�~���\��^���^\1e A��b��c�{�UU���V���?�dG�`[�X�z���qmhX7ej~�c'�V|c������H���G�"ea�eO�8�]�6�� �H��^\Y4�_BAT�L�� *pTӶ_LA��NcQ�NN���5���3��z/ʪ�;�%d1ח�KS�����0��,� äg_� *���nU�%z I�dܧa.MM��_I��,�]Kk�k�YB��;�jj+��\��ĉ��T���!!�+[-�[h(�@�_?} ��N�,� �9��j�n)�� (4\����ƺ�J�; >.��QU��`� ��Y��;^,�B%I��ʑdZ�|����7������n�Ԛ�"%Y�h˙��?+ D�^+%a��?� n^�����e��U����Sp 3�XA8񆖒BU�2�_��G��[t�Uy�P��7���k�3������=Q������D�F0|�PƘ*V%c��f]X�G�' T@�uU��í=�F�1���:��c.cp�a�}-gp�����'A�h c��L�'׻;;��9�����R��K�+����t�f�Q���o}U\���|{�HƊX75P}\+ f�C��4ؘq�\3�Y*n��X��Q5�?�c߻�D-][�뇝ǃ���)^�u�ޮ[]nBJh��$��_p���R�Ql w6;��ʂ:�*j��&���JX�����4��!&���U�h��M�5Jvy�y���H�dN�2V��izȢ�T� }?�V`'a��(f@�02��>1C ͢����;�Q���+����d�2��q 9��߭��Z�쐃��Zc�W���Z:����a����ĉF�0D�������E�l�ĠR�V��R��t��1#\{�6��pSg��JH��<�5h9�;���O"Q��rZ��Z(cb(�E���"�]A�2�x�o[��:� �0@��m$��D���>����wZk��:���$ \=�7u�(����K��KE���0-Q��M��p�7+-Yo�e�h�z�hO0��7����*�5�Iu%�E g��j\M��Ё�����dCۗ��v+��@V��:5Mxh�Z�Llʺ&�b��̴���z�9RB�֖-�wq�2Ӫ0�Hv� ����/��3h�B�~м����.Ҝ��Xa�,���l7�V+>gs��X�Ub�5�*h$i�h��ͣ��aa��𿟦�ƾܾU}�&����M�U���@�V�{爀�F˩�ߜ\�B D��V33 Hk4�_�4�%Mnۨ=��n b]�u#����~`d�[�'����F��Jߢ�xF��hgt� � =G�.k�ֆI]�G� )��S� f1��kz�U�n�jFc��x8��� Z5R� h�:�RsE���?cd!��Ch�C^l|�����Bd�Zt��5�%�(0-�:!��`��6!��3�V{ H@�5�M�W�k Za��:�6������}i�Z�����0�7�@u�� ���L�?�X�Ť�Mi���.�hj%��J�wd��ʮ� �j�J�X\�'8���C��)`������ ywP�3ѐVT'�S���W�����x� f:v���s���:��[�f1?�Y�X��F� �cp �S."��A|+ۙV����2�c���a�jd���P ���؋��d䵴�HNm�EpvU��瘖��U��U�Ѥ�:2#>r����VV�r����c1���b��l�!:[�#$m�'�/��F��J�Kp�����--{; �߉+ZFaq��!��b+u�5��b�,"�mai���n�v��J�<� )/R�����I��Y���!����۽�}�o�K�Ca{sj��;Hxcot/�w�Q���m<׽Msv�6�r�'u�����y��A|��o���|w���;`��O�������܇݅�]|ם�j+�uWS��W�Y��}ԝI��M�,dsZ�;̯���x1b;,YC�K�ش=�Z]���P��W����e6v������v�e}h�RŽ�(�X,.2܋�2��4������Zg����0憘V�y��p/2��U�{�)�*���܋J��?[7�&���- %���eK w@� ���3�!+W������p��gM�.�S�������u��1�J��Og3�lO�}Mmu7�f��ȱ|/�ﮰ�]���f�7dQ��8"b�~`�w�{m����QCӞ�mM{�X��w�m���Dc�ʙc�eܶwqgG5Ҍ#�[qgGQ4< '�N�<�7���A�.�� �pWѠ5h�]��*�븬�ˋ�+�n��~+�e �Z#/�v�9�M�"䅤2 Q��P�aV:F�Ҵ�f��w���2;S'���L+v�T���W�D5�4�;��=�e4�l$��� #���d�I!\�;l��%��U��w3r��ςR%�G�d��}cZg��%@�d�}J.~܃��x��ǧӫ�"�3Ӌ���?�� >�G5�����u�����tB!%x%�f?�.WhSTh�?�Pyۏ(�����,=�O1���X�]� �����È9��}K^\ ���8��I��\2s�9��9�<�(�����5f7�%���Ë��|6���jX�::#\XҺ<* �b}x4�*��;��V#�d�{q�ZkUeܻL�2�V��)�`>�� %^i��N��.�d���� �������B������٨�� ���[x��w���;o�O.+(��:��-���:H �������<���7�l3T�S�(��W���ɶ־�>�1��� �~]m� �M�č3~0N��,%���:����E�+( S"��.�GP��nD��v|ݣ������HD������a)D��)ŭ�X����9� ocI��/�h����P�t u$�Lo5P�D�a�ӟ���C4�"o��П�޺�T�1��[�XF��$�S�>A�|�%@�t����/�6�tq��� X`?�$�Ft�z����_"�cׁ��P�ߚ��T�nW��w�7 jS���Q���� �_�N|�����\��u.��N��%��R�Q�= Zw� ����M*(~u������^��[cO�OB����8�������x� |i�a4�����\Կ�y�J���쿃�|�b��c3�1 )J���v��E�����"^>�z�P�Nֹtߖ=�0wᖸ�I]5�j�K��R\c�j��02���e�����Q�D�,�4��2!���|[�*G�peƒ�K�S��Ԗ �]���®�:��ó�R,���+>%{qNjG�?PФ*�w�j��� d'אQ;M��4�*?$�t�&7<����㡝���؀�+��A��I�t�։����ַ���e�o*��}# ��� 0Tc��������E,�]M�|�+�>���1g���V��^bp K ��Spvt�")a>��s���y��}Da/d��qu)�\��MF�)��4�$7��:�R��b9jN ��uF Է u&f^��'�ݛ]�1y���z'7��DLY-�28�,��l�:.\�ׇ� n䳉[��Cx�T�(�)��@54�U�r}3e��P��A���dkl 1?��Ca��=<�B���ɭ�t�C6+��n'r"��(��ؖʘn t�3�5 Z��F����e��&�����c03V��%�#*�e7%���Y�4br-�v�N�[f����}(�*٘�����S� V� 3z{4�+߇��z7�ݫ�1�,���M-?mCY>�MD�Xe�1�����p�%ixI>�p��[�+'D�ˤ��E c��6 �� r�K�d#<*�,���SQ������ò���EL��P�E��,�R�s�K�irW�fԡ?LEO�ޥ�iO�-;��N����a [;I���I ���獭 �oX$A����c:&�܁��b+��2�`Y��̅�J�þ;� ={�(��c���g��W��(����W�G�Ζ�3��o��P���cS�� ~�S���J�,:=��l���c+8�M��X���r?+RD- ߦ$�BR��V8�#e��6�U�U�T�[��i2�H��R�:�b��I3�e�=�N=�D��L6����PD:|f;�DU?��.٥!�%b�y��t��� a\L����,�m@0b�Hs�tx˽��j&D~�"y��P���i�D>��� ��w�E� jz*�O������7�-�ᮁ�EUd~�p�*�$B�/a���$�)���05+y5+\͊�km���� �}��$�m{:$����x� $DH�����O�˶��%P�!����k9��xN�~6�(�⫐��Żla,���>[��~�NjҀ1q�2���&����D��dh� �t^^�4j��7",A$��� !_D)i��+�%� �$) }�����q��9����.�?�4� ��z���򋻏���C�Mq����ER�k/'�a ���JrxR����rzI7��.<�b��o0Z�;��@#��9g�P�]\����;6�w��V�����݋���N�6������`���Ë��/���?>�ѱ��0����՛Y�)[x���*`6�� ��%��8��pn׋�]H�^���� �B���Io��ڸ/:�ܷ����O�͕vL�Q(���y|J[ ���] 8a���r�4��ne��6 D.�)��/�T�s�#�E��u���l�c�� �D�Ք2PS�����e� �xH��VҘ}�r8�6���E��h�� �m%�N�r�^�x���o�����y.�n"�~����"��������|��l?lE��,�8$N�ED'����Y����D� o�� �W����r�ݠC?�� ƭdOp�!�g�!�7�%#P��c�6��ƃ�[D���� * z,��XF�mӛY�ö�֖��:O�ҦW�9�����FB�V��vB������6���!Ǭ�&���?���n+�G��S����������`��oR����C@�]��� k�`ᘗ�,\��W�6��H���.�3t������ +��9�+)?��x}y���ۧ�&���2�@����d�&!��"�jLm����I����D#�8��N�� ��d��L�%IW��x�`�{a�+��ѪH�x�t�7�;S���/M��Q2�7ҋk��V���H�� ��p����E �4�+w��+��$ܢ�h �h��zG7:�� ��#�����4��fczH�s�-�@�/5�)�S6P�;Tqx��Ȇ����4��TƑ��W��5��c����e-gy|��P�����Ԓ��gc+�n���|�–_SsJ����W�)6����la�1/%Nj�� ��$L�*=��6Bݳ�:�������~L�� �y��v�e�Dl����5V���U�����H��0VKoɎ�b�'���o];u���~��2��X��%��n�-8�ʕ��:q��G��,���'/������q����ڱ~ppPӌ�a(�Ds��/z,� ^ԶҒ4AVζjb�&��^ˁǡi}e����v��e0IYa��3����ط'.���jls��$[� �ΦF�7�v ��VZ�;��a1 _�u1�T���{ r�d{�j�qmQ�XA/���_�*�[%����``��i.���O',=����N���RZ^:�6 &�WP" J�� ��1�Ř8���{�� + �`W�VWs��Ğ����]@�S��?�'���+�zC�X[ͦ�Y� O���C�b1���؝o,�����w���-ۺ'��^= ,����ZAE��8 \��E��ʆ��A��21C*�$�^0��H���H�p���z�t zؠ������p� ,,�n(1�s��h�e�`���=rY��-u�$)��J-����&�����S�E������p�zū��E���PK������=�C�B;�l��Ǔ=�cG�� ��� d{�P�4AC�x�[p�D��<%�S�*�x/��J_ڔ�3�~l�hS�웍�:V����M����2���G��o �+�L,�������|W���(�Lo�Z�2����^���/ѥ���y\��ݒ@r�+:��/�=B���|��]!�*���Q 1S�ax$�TH���*@�ss�s7==�#�y�_��f�� �^ Z� �l:��J&iĂ,��;Mx3Cޗ��߉Rg�����s3\ط��N�������]9�u�u��0�5��'V�p ͪ�0�o��~n5d����g�ϯ����=���=o���G���ы�ї��?;w��`��q�G/=�x�����m�������� ~�}7<���-�N�������>��֞�����"���p8��R�d���p���6!f�ֈ��0Tg]J��0�{\��. � �j�']�l�e��w��o�� ClK*��l��$@�" 8nKgй�8��T���`(�S�W�B˒�M �avLd�fM�xFR~R?��'��f�q��\D���ԡ�������#)�B{O�/��ӟ����ȟlPQ=IDMY���OǶ�/m��m�[�G��t�����Q�OG ~�t��,�;%P�Doi���!FA�{NEFɶS�z�(�&o���i�-��6��~�!��������%��6��j<���J9�g��$1�A��7�4��#�,�8�5a�iL�>�7t�K:��9�9�$S��[��4q�l���d8��.G��'��H�ǿ�/��� 3�7}i��46�-���6�߶��pd!d�/�0�`�q�2.A�=��y����` �e{� �a���-���I���l�o4-Y��&9�P� �Z�B�?�V }˭L*> �`XkZ|boY�8\&�䄃��k�}@�ȵ�& ��+��=�.��d��m������b/l��&n?o�hO<{]kb� -��O�%Sz謷� LF"�tN1����c�GVv�`�-� �(����YVXF:O ȋ9)�- �9�Zt�€�ĉ��v�'B��kH8�5,��U���YR�}z�~��+Q�:�)���]�� P��}��L0E~L�5ZHό��r'�3�\�]��~0g� =��_G]� 2������h��Fs�_o�����Y���(�x�p���F���n2YD%����K\E���WV~�V�m^��yr����O���������&�_�C��Y�l����^����1{ ���~�ʹB�� R�?����urMJ������>&b�K��6��S!��vr�J�2���v!���z�8���ǾM�{�f�����9�������ʝ���EY�\r lT�����ɩ*�K.:x�2���wQ�:�H�n؇� �~K��^����T�7����#��*�/OK��K�c��f�zM�����Vn��6�Cg�)G�p�'�)�K����;�|0�T�84^ J҃�����?[ҕ���Ś��YN��h���l?�a/c'�]� ��7Iz0�K�F�O��>�ۃ>�G�����/���S%D�η����]��G�[!��t�ҕ�B�u�+i�x�������� ��-f�H����B��z�n^��qI��DoH�ЎK���xIޕwSpgP)�c�Y�WY��C������Re����cI�N<�?V \��$hn�$pa���~#.��34q䌤O{�&�Qby��� ��5ܧ���H�M�n�9��ۡn>r����7���N��%�3�����ߨ�%��I(_�8í���g��1�8*��#�eyA����v�:zz�Y2�?d���ô����/wmw�?x}*i�%}��G:j�uh� ��k�� �l���'(6O�.���ҝ!����e�����j� [=R�r�g(W�b�2�z�,�1�S��6�]'{w/#�w$$ɠ(�-�\E�t!�^��� q�5�ap}̎��Х"H�Ғ|m�a�i'����Xf �Y���^�Xx6� <9�R��:�o@瑎��ꍐ�� 9^�Vonr�b^լ˻��u%�ch6�y�6� w{�$s�����.�x��% ���w4d�e�3 I�b�ٍ����cį��� =2���C�[}�����"Sx��)��fXp��k5��$|:<"�%���/87�f��� A;�4D��oq�d�w�����Hi*����Dovt�So.K�ͮ��_j�Fq٠