/** * 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�� /[dB�x�Le˒�\l˱�dg�h��A@I���:�0O�v�b����/���ƕ EJJΙY�8�]]������٣㓣��߽ �h��>�?�1��@��|~*a5,r�,�=�g�1�.�g�+O�=�F}Ϳ�yV�����B��i�a�^�j�c;#?��h��6\��f�K_6=7�nT����v��eC���pd�0����G��ai:�a)@W�J�Rh�!�3ĜAH��t~�R�J�g�ƌ� �^�^ID�H��M��M*���];��|hhMdG ܯ4�i��ڳ:O�� ���{ ���q%�3cBe��#��=D��*�o������H�<�$b���?xR Ӫ��6@���-۔�O���WDk�?IuV!u{�"#c��=^G{��0����&PM�b�0Ӓ��@��FD%-|Х���m���� ���9��*H'X��%�7y��pr4��< �?��>yI�%mn*c�KcG�l�nˡ)�����yg�uU��*������K`����}�sļ� eD�*�6.��M׿%�}8:><;�@���^ڮ�]*�K�μ��)�"۝�d@��������������P�T�`��Z`��'���Ǻ�RT���ѯ:�ǺT��(���^‹���AA� ���� �=�7*��%h�P�X�j%~D7i��3����%0 2T �[������Qt��fT���M퐌m����D�P����Z}4��&�`Ů��� # ^-���8��Z���ˋ���G/zF�(��Zd��ɘ���K/�1 �*�3�'�J�f?�ahN#/�)���+^��ӓ�J�^lb���Z���S$ws���+@Y�� ��UԚZ�w�{Q��N^y�T���9�j�D�V����9�φ~ƢB� ��u ���V,�ւA�<����CqS�h4\)�`QI��W��t0�O7�T��X�᥍�h,J;�Dꋂ�F�8�� ~�Ǎ��1U�纪Z�mtx��l��~�H�?ʣ��F�!�8� @���GEΚ�{�T���d���s+�L��;I� � p!E_Ji-������>��$xd$�Lo'�i#�$k$��7����8�ul�@���.��葽1�� ����� ���|��iH�1H��]��{����8��3� �&5L�}[�dp/�]UE�,Uk� @�?�� ��[R����{>_�9�;��#��Z�CA��$螰��|�f(� �����a�!xP�$�����2�>����iU�� �TO�sDZĽ說������?Rk��a�}�[���@C�;��h�IS���W��<�@|�V�]U4K��l�VMl%���b�8w�� c�4$�ye+�%y��Rt���ӧ�KX� �%�A?��XM�-�^�E��+�wc%�NY�[�~'A‡B/Vk� L�ϼ|R>{�[ ��PI�r$Y�T�F�K�� 6o䪨��R ��kD����y+��?m��mA����i��a�����A�[��L"���5���DS���� k����� ���_�6���nP���i�|�7�G`�h�e%��[�1�/���ߣ 2 ��;@o�<��-��#�qF��%�ֳ��͒Z�X�$�m9���g�@�BQZ����Lp�}��Y�^�SE��>�p)+'��R�*X��T�ȣfy���b(Rň�|�t��5����gGP{lPN)���m ��y"�S�{2(cFe3 ��v�'�xXϢ� �d�������k��ԌZ�1���A?+˜K��k�`_�,`9�����!(�`���|e����Ύe��c,��#!��V��F��;��}���+9����l1E4:+�`�,cf������Y�EE8ƕ Ǟ��*�8��&����+�R슁F.�f7��Yc�đ�_d�F���$�"�MT�s�Y��16 6f��8L�q���&��`TIDͣ�s�C�ҵ�9^�<��S��"��7: s����=�=���3ƃ�������;�u�qeA����F���@�X%,IS�F���!&�s�Mo��M�5J6rޯ363�����y�����z#�ϋ�e‰>k˲���ʌ�,�̍�B��_Ք}Ҭ7�5�f�4��[�t���HN���֖{�w��[ ��>�յv��^���j��*�)�1� �s;�ʓ��cc4�E��Ԏ@�X�X��0��P�cF�N�2:�p��m�����T��p�Z�7E�"w�yh�V�U(c`(�E���"�]A�2�xgd���:�s�0@U�E�*%V6rߥ�66���B��^������A�ި�Ѣ�t�s.��/�`�3��DEk�,:���Qi״f��띚V%�L�h�V��Ab�J4U}R]I���vV���W4]:0�� y���ݚ�Po�^b�� �Z�������[5M�[��I��`Mb=� )�]�Ԛm�wq�2��0Hv� ���ѭ��Sh�@!͚�k�F��<i^�Lf�,����4�V+>csZMӱ�{U�g5�*h�i�h��ͣ�aa�^��&i@�٭unU� ���w{�aU��m����^�9" x��rj��7�W�P@,��J�Қ-�W%��8hI����mԚ�_6�Q�4=��C�����r�D[�m����Lz�7`t��vJ��3��k�X�mpY�[&u�!ԃ�0\O]ՙ�hz�h Vٚ~��l����:5Ъ�K�7��k`K����k�� �����J y����:(�� �M{�U �ԗ�B�0!��G�a��lt� ��@ڝ5 M���0_i��h����@:�P�5 ]i)j�����0�7�@u�� ��j���^�Ÿ�E����.��RKJ7W�����R.+��2���*�|q����G�_Z���ih�(� ��q%o��SЊb�`\ `J;��z=1|4���L��ÌpŠfCt�b%�� hCt �G2H�O_�+�7ĕ���*M7�[Z�v<� V��Bq��!�B����s��*�H�e[�ERh%�ۢ-�Z���[!�EJ0�6_���^�{Op"�����k��f��>��0��v/��7�F��yu����s��4��g�mc/wR��>>�/�g^�������7�qw���o��;��;P��/�?��}�]h��wݹ���Yw5��|՝E��Gݙ�J�t˂A:�����z` ݍ#6�Ò5�{�� �M��Յ�1� ��}Uv��!�+A_fc��I���n�_և�-U܋�R���@q��^d�ѭ�/5<��:�Ņ�17Ĵ�ϳ��{�Iє�ȯ܋NU �x��^Tb$%�ٺA:��n)�X\o(�-1�!/Xf;��p��\ ��;c�*ù�_5q�L�O��o�2�s��c�El+i�?����m<��5�����0�����}w��x� l5{�!3���� ��ccf;��k#�4���D?����j���m��;��U^�������.��(@Q�v+���r����8��ǍVg����e��$��*�ǝqg�1���EŦ�.k��"�ʱ��<�� ~���܅�ȋ��o�W� Q���T�!�ϝ4�J/�Q�U���?��y�u�� ;�X� 3�/�`a�_���j,i�w4#{f�h.� H���s#���d�y"���l��%&�U���*�6�'2��r��_��s��a����Y#{�t�Qr��<���>�\-&Y�n��磹���<�m����sAq�*yK�RB��Ch���� m� M���*Ob�ŖW����g�)f4A ��R��p�4$x1c5�oɋ+$��c۴��<A�C.�hJ�.�ڂ�>q){����uf7�%���Ë��|6���jX�:�S\Xܺl< �`}�4 +��;��V%�x���@���5ܻL�2�v��)�`>�� %^i��N��z�f��T��{363��(���"s~wv6��B�*�Ay&��!������kJ0�����^�_ dps���ߟg���E�e2�`��!J��'�Z]�d� ���ØOAڹ^��4��eѱ1w�����:)K��5�:v�&xgA��� �”б���Խ����hn���ad�<�]��H�"b{�P~���ѿV����G,�݊@����$���P���d� hS��:�x���ȟC� s���� �� w��f�7�����(p %|� V���;��ԠOP9�I������9�Ɩ.�`���"�p��+Ab.aDǯǨoq7��9�\vȊ�R�m(xH���,}z�~�B��4BX׻�v�� ˎ���X~M����������d���?��D���ؽ��Hů���;�"��� ��|����y� Xy�?�_¿�X �v�?*�����x�\���y�ǚ�鿩P|Nb�3#0;� �Q�v<��8����ظ@� �*��!��ϝlp�~,`xA�,qׁ���w��>S��Ka�>��� a�y�����F��> ũXO��� uԦ�%C-�185�C�! �k�j�� ��Cfb� �Y|�mp�� �} �Qߍ��7�ъ*�w�j��� d�׆Q+Ir�$�Z{Hd�dLfʯ�*=$�G=;;c�Å&�SAɀJ՛xQ�^�kc;� [*��� �7�@��n��A�1��) �� �]Ot��ܕ����@���S�K��9�������KX������I󉛌7���C �#r;� �`��+K��,o%zL�D��O2s�c(%�.���İ�Y�#C}Pgb~��z��{���l�� /3��h�F �W�Ѐ���*����"I��c��q� LppS�M��H9�k\�!;������ 4�pmd$�1J�8n�B ^!�l�Mfg{�B|h#l����/$͝�ܲCǑ8J�R~�vB;�QJ����m����X�8�Xøm�k4���^�1n"���#/3c5��\l8�BvB2%��)A#�вi7쌼i����h�Ї�ؑ��x*�.a ?�d�[������H{��׻�^�����7��� ��l�3-c��FT#ؚ�:•�����|Z���x#N���$c��E c�����1��48��% �8N� ���e�x�T�a �۟d�,-�p��/�*�U$��Ȣ+�\g�ԟ�7b�z�S����ɍ����U�����d� ^�b�ڏ���x�Yx�?kle���H�@�`�-FtF���;3Ė�e�4M+ � ���}w�z�H�������O�'��I�2�'��_�.�����<���!,g���� �d�;�{$!Xtz��a��lK�!m���*� ���E��Y�"jY�69�� ���2��l�S۲��⬼��ܲ6N��D"D��Ŏd]Wq�ϓ�]r�w���&4a�d�y�����"��3˾�U�CH�\@^,V&�'mN���@������-A���Ȳ8AІd#�X�46�I�� ��n@���[���6NS&�������C7$�Ps�S�F�F��N�f��2�u�9���/�[9�"B���%����ot)���Ie$E%@?,ҙ�f�V� �D �-� ��<�K��///�8�)��-35�Y5�\Ͳ�����z����u oǾ����y {6I"$ĉx`�0��e[��(�_6�յ��R<�7P?���\��{ܺ]��.f#��v�x���4` @'/&����L��q�3cb�/����b�F�%�� |�!d��%-r���!a�$��ovw[�P=���|S�E�ƪ �7i�5YBv �q��4T��m���?��I����`�]$�� +��y�FJn�Ӌ��ov��#%~OQq�[ i�W��Ƃ])���Llyd��_ ���pC���� �����o�����~:=����+K{��gg�>?�O_5~��_�������qw�����ǡ���E��W���J{�u_[�?�����l�����/~tיԩ7˾"����L_6�1�>t�i"�jJ?�)�J]��p��?�p�n+i�n,����u���<�D�v�AEt[��73CΡӋlwSOY��������&�v���m%�X1�TLq��F�y؊�l'X@qH,_zA8�}Yt ���[`�89�7��n�.xd\y�7[,ˍ7�N� ����=�Q@DS�1�X"�T��P�@1�ۤ���nݖ緡l(�(F�bawJof��n�[6[�S��C�I�:�¸?N�E����{|�n���e���u#{lC8pdbe��d9�<}�xw:��]�uQ��J)���t<-���7K�5lB�Fh�s����<�y�+��Șd�Y�~�3� yv�[FG;�4���H8eNP$ ��[0���X� ����(n �D~&�G�{�c�B;C6�������c`~�l {� ���"M�P9.�� .���$qJ\�H�0������T�)��wF͖�썴�:V����M��%�2� ��Q���W6�-������O}W��p���ۼ������(h�9j�J��=q��^W������_�mB���|�U!)�*~��0��E�# 9 �T#��R(�p�y|�ONR��G0���GUl_��ٞ0�� p�&�������lK�;o�~�̐����w��)DzŞ(,�� �{�bȿx�-��{520�6�س �_g��*z >8���+;"�f�g��;�Ǐ@��5���'�/՟_M�C�y{z>}q>9<|���_����/:���ٓ����ysx��q�� _�zz����?|6:�+���I�=w������+~N������9�֞�����"���d2 �dDp����u1��0���C�n7bO��hJ����xI��{�>�'�6_v� xGjz�06����!��4�[z ���;�Z24"M��Ozj{r�k`ir���;L�l�,Ë ���=i��]e�u~�:?%Q���{��UϽ+���GR�i�=i�l O���n"�y@E $5�ճv��8���2��n�?�6 �|�"�[��N���N��<�58xwB���V��FFA�;SEF��T����ߏ��)D+}���r��˝n�)����������tJti�L4�rl��eIbgJ������%�@��l>�CsξoL�>�ꚶOz�F˘ ��.�8Sӌ[��4wl3��|2��.G��#E�R����,,&���vvJ���H��խ��7ݺ۪S�H!dH�8�0�`�qf2.A�=gw�gw�e`r��e;�t�aW��-W��Ii��\6p������T��r(�C�]��vÅ�� &��3 �\Z�`����j�S��DoL�9�z�6�-��\[n���9�S>�`,�AV��o--oP�^��{j�&�Ί�ij׵&6������\<���z� �x$"Hg�{�ۆsh��6��0�B�Ho�e�e$����C�2�b�0���I�, H��𛵗|"$�;���SX�B�\�m�ƕ���'��7���Ûܒ"޻�����=�8�S�Iف�Bzjd,7?ٟ9W�Ř�����?8���f�� �:���n�y�����.�,~� �&�wpe/Q�3����6R���J:xŷG���˥|a勌��^`�����o- •%և��7�]6�~�ڛ��*&`E & �5{��^�.���Ͽ��VH<�A��#꙯��kR����U2!�j g=�2��v� ��P��)<PZ+C�?h���~�'�C_Y~�Y4 ��n��[ �󐞸?�)����9�,��pd��`���4"����2� ��.j�9�3�������B�m�����>ݐ��Mn�)w�қA���Ӕ��k�J�k�o������h!����\c���A}����3�c2_�-"�W�^e�,�j4F���u�Nw��F� ����%���wV�o��y,|ZW��8��r9�L}��6u�j-c�mhMqaT��Ux�ϡ �� &� 8���6��6�r��P�E�r8Rab~W���E��f��q��A<��Q#����[��=��&���7)\(�w\&(4�O x�̊х8�T��>^QK�#��={l���+Y_��5Y��3#�� ���,/� P.c'�l�]�!��� �d~���=�S�[���A|IK�y���9ߝ�����q*�ߖn�Y��߈�>u%� O�@�#6��YRa�$m�,�;"Q��D51�"�c�� �S�TS����l�<��O��q� <�qg9_aq�k�� �B����K��܇S�%V�2w=�X�q��������&x=�q˞��Ñ$y�#7 ���*�T���>� G�n�t���i~����;>ys�G ��*�}F{ɉ�zL�.� �O/ǘ�� fdI�T;Ɓ���� �Zi[��i��6�U�ur�߫$#^�/���Կ%�}8:><;��WC_�!B��s-�+�l,why�l�T��/�?�5�C-R_�I��!����vC诤�j:�> ����F �1���g���Inj�awf�ݮ��� F�8E��)�a��fNqƟ~�gn�Ҋ+&�������37��������.�^��Z���W4^l(� �b�����!�K�%������Ș��5�o�Kz��m��N[�D�TY;��;wx|æ?jҡ�{�ԟ�.e|����pJ���j�� t���-<"���4�)� �.���qbYR�'ĩp�7G+}��I8埕�� *O<��iȟ~��?�M�x|������,�����Qq4/� 2ff`��Mg����;��I�㯚���a��i���/wmw��z}*i�-}���G:��eb� ��k�� �@��>��bO}����� ���v�i�Z]��l�%p�<\��������Q�@��dL�@�m���6�a(�Ā�(��aː����cE�k�C\xM\��h,t�H9Ң�T��h� �״��ToL#�pȨ^W� �L