/** * 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�¬�R�(��]��۱��%�ӱݽ��EB�d��e��Ϛ8O�m��ϧ̗�*���%��3s�q�m ,� �B(@�O�O��?�{I&��>���?�֝�@��|q&a�Mr�� �X�q���X�L-G�Pk< {�w}�_���m��J&> �IzA�Vsm�;#�Bϧ�pR�ҝ��NksO6\'�NX����r�ڼ.�n�۲�Z�f�ڗ��4mW7�@��%�� ���-/D�4ԉ1�������D�H��p�)HW�{�JD�Hs� '�^Y�ه �+��|`�6�Mh� ���1��������IT���kZc�����|w��^Lmo�_��TS���l��=����g���� �Y�J��\!��� ��� íCKXN��,CF��+��]���ĭdX����N���hhL�x���j#�TǮ;�V���q�Ԕt���C*�p�juϳ-C-ש�A���ԆW���t��ON��ɻT�����7&乯�>s��RS��rF^�� Ǝ���/ؖCC�� Y]i��BS�F �tjC.�9rYUd�.��B� �q�~\Z� ��Bo!�k_�+=��o����GLJ�ɷ�ݹ��z9����b��0��q@�F���m�'�T�T ���?�Xg >AK��S�U�TS�U�Z�Tkk�m�SM�H�ԯz�>W��჊ �}��~v���Ի����}�j��U� ����D�_V�0��L���+�Z�vU�no���'�|bddٔ�_�:�:�L����1�ZKV�)�\�>q+A���rb�h�&��]8� f��s�A�VBk O���:'ǀ�\���=�ʷ���9 ]�V��#_r+?��������hQ ��[Ћ1Ar��1y�4�5Z5@T�=5’RQ*�Yw�^�����pV���>�f-����\���4E1�wKo�i%�0V����{�Ek���s]ʿ�HR��ϟ�9k��aC��F��z�R���3-�o�$i��S��m���TB����}��I�6HIj"�֊�?T�R���xU�Ԥ�GQ�c��xj:�U� �#�#�R���u��p=��y@��V����{�����8��3��1�a�=� �� ^�����-Y*W􁏆�AtI3�����{[O|�� ��E�r[����^E��$�p�p=��W1�H-E!u "�C�6 ��{t@� !i��o܏�� ,� A��B|���b�*��j�Ph���R��pW!��y4�l:�m������ @�%BY�ezp;�6�*��#�a�+NU��`p��|8�:��J���A��*��*�y?A1������+���8B����7G<�} 1;� ���ы�f���k Y��� �d����=��K��a� �ˬQIr�_��J�HO�!əM��O�U���W0�� �k)����%����V�m%]��"�8���c� t$�ye/��r�������ᗰ�S�;+,�~}���[�� |� ���F��=cCn���s�pP��R0/��s��k9%�@� �$��*G�%�A�䡷��b�F@��R�,%�\���Vz��������{�Z&t~יr�i6J΀���AP1`�{M5!��JAeV� �௫�:�N����>��������p�X�`ϝ� �1��+�2�T6� ��o��ª�4J�^P�lbP��{|����(#5����@�|}�Ua��s �5�@p�� ������T �0�XT~d����Ύi��/z�#!O�)6��}x;t}��=���W�r0�A݅���Q�4���E/��?��Q�RU�K�AQ!�xeݶ�&+�eh~c��[ȕc)�@#��v7^�Yc�ġ�_e������$��"�M T�2�Y��12 6g��8 [p���&��d��>����\^��n �v����h�O/�ҺVo׍>7!��Mk����]�Sƃ��Gnd��ĝ-��¨��͍R��B���@�X&�H�������!&_�S��֤�ۄk����~����ɔ E���#���E����nx#��� �\[����1Vfdd9�}���ETC��H�V_ T�=R�5��H[ �!9�rjK�߭Zw-X{�[S[90�{ ��G�*��X�ά`"�}�ZO��c����J�Y�e a<ݦ�ƌp펩��ᮬ+˔} ~�1ҨF����^w� `EΘ���+WG�P���Uл� DeZ���4��u�g�a��t�6�VJ�l�CMud�Ý�VZ�:]�&ڛ�����aS�y��,`�\�-�_�"�>��q��Zo�t\��C�Ԫ��vE���L�gXXR��JG��F���򬼒t^� ��W�/��t`��Qb�JES:���I��$���N ZS�%Q6+�" �b��L����z�)RB�Ү4Z��.�e�M�/��X�Z�S�'6��B�ۼ���6Ҝ��Tf�̟M�l7�V>esjEհ�e��5� *hDe�h��ͣ�ae�^���e@�ѩ��T� ���ww�aM�)-����^�5" x��rjl��g�wP@,��L��M�W&͈8hI����mԜ_7�^QU-��E��v��r �D{�]���t z�7`t�vB��1���)���-pY�;;&��!ԃ� XO]јŨZ��u�تv�M-����:Ъ֍�7�ë`K���k�L!�����J y��i�:(�� �Mk�u�Ж�O7 ��G�iB����tH����k@��y������@hUmH@��zg H@�U�U��pYvt���� �:�?�yp�BĿ��oŨ�I����.��T j7VՆ���P.���2̫�*�lu����G�_j�fi��(>L��q5o{� �i�j`\ `J���|3�=4����}��� ]sArXn�Y:~���_�/y�#��g3d��)��)��*����V�i]�o���2�c�~� Â��"��ā���IKkiM��ڊ��� ��!-��V��VuSD��Չ� �oŌ�\�~i�,��^|�8�A͆��� 0�IІ�l�x��!��W5n�+�/�U�n�����4x$~/�j��LcC�j+u�5�|�U��˶0���J~�E���/��Bʫ`�}>��u�� ���!D6�!r��x��|�C(l�aB�A~� o�D�>��M���z�in��.��^����}|]_ O}x�w���{ ����놾������A�a���7�a��u�u���g��Զ�U�esuo+}�ɚV����t7ތ�� ���&6폫v��6�6�U�͇�d�}��ݽ'�0;��Z�U� > 1��M��]F��f����"T�l7���*?��D&AS@#�k� :YT��}�Q���g����M�R�1��P�/�b�B^��vp��Y�|���x]�s�?k�t��.�o�2�3��}�,�4֟�V�YO��Vm�7K3�`b�<4+,�s�4������ 2�HD�ߏ��e/���}V?l(�3���(ϟ*�N�i��W+��U�-s ؋�rwv�:@�a��wvd9B��i����z�=lt��p�\�b�8�¬�Qk������ �;�c������=6v���z1���Lw�x1�9� �������l����(����tF�$x9�n?�/7hS4h���{����#��W������S !���e�`�y<����ڷ��5 쬑eXႄ.� �&s+���9P[�ߧ%#ט�Ubw�����d��~x���φͿZ �{Go� �z�����Z|l�AIU1ca�l҈v���J�\��eR�Rm���_ �#��P╶��Xin$k�lL� ܛ��1���B�������h� ���x�����{��G`fe>�^y� d0�����γm���}�^���%S��Vנ�t�ڗ�g0�"�̨_�6��Gʤ#}f� ?'�uR��k���L�ނ"����)�m��#�K7��pfZ.��AhM]�]��HD"bKQ~İ�ѿV����G,�݊@��7�����@����� �S��:��Ko5���A�ӟ���c4�,o�o�Oco�Q*�jx0,@� 3qg�˜�p>�9�?��-��K��-]�A�E(�r�'�D\Œ�_�Q����K�:�:�w���S�j�+X���^�J��2BPkhm-G��i��,���������x �P����7�D뮒��ݗ�!5I �/���;�"�=��+��|k����oX}��?�N��j,�/z�?�¯�Zq� ��\ֿ�y��:(����|�b��S=0Ɋ��v��F���H�B�U����A����{��ҭ["�p�Ե[��'��֮6�dD1�����4Qݾ��Y�N/���W6{�$'fa�����@m�2�9��]!<�d�=u��M� �O�bn"�{�p�݌��L�r��d'�9�DvG2�T���Q�9nX���edԌ�7.-WY�P����[� ������Xt@�%Dw���2Q<���s��z^�� �X��7]Ⱦ�Z ech�����=Lɝo��b�^��|�Kd�>��y���~��hn�\�����ݠJL�/�|;t~np��&�W��#^]zIn�r��S��%�>I��ǎ��(�X���&g�� ��C����v�Y�v��+�2�w���z�7"����D,Z�Pi�AH����3W�bR7q��m�C8��P�S�.���{�@�z��@��:�'�52z��E��JPK�}����@\�๢���[��(�lVʏ�N`2J�q4ѱ/1����ck� e�f#�;��b=�M��u�`f��3�� G4���J���:h��Z�얝�7t^m�P�W�Y/%7 d��}skz{0�#ׅ��f7Y߫�A��AX�Ɩ���=[�D�Xe�!�����p�%�x�{�� P�5[�-�G��ub�§"�1�^c�L�_n�`��.�O����-�h�T��/�⟥ڰ�,tq�o���'���b(u{�4�F�e(Z�S�����m���c������� ��c�ڋƐ�hUZx�?mlE�!O������-�tJ���:3Ė�E�0 + � ��cwj�"���S���g��W�$����W燯Ζ���o�k�m���)v���)� ��%I���l��/˔q��� n��a��qV��V�M�F��0�7 6��2M���UVS�ۢ>N��D,DR�� eMSp-Ϛ�=s����&0`���5�����"���i]E� �%v�.��]$V�5/ڜλx� !��%I_�r/C���A���cR�|�&�q��~M���˓7)-��&L��4U#�up�N@Π�`�"�$�^���@�F��0�5�9���/�[9U"B���%�NJ�v4)��IE$E#�8,ʙ�f�V�ŞX �%�t�]�k����y5z��Ė��崚e�fYS��Vo��vCmw���wn_����*�5� b�D<0mR���b �q�����Z~{"�����g%�|�wym����e;!�p�4/ �Eë�7>��B;2��h{\MY�X.�+��F��/q|#�DQ ���U䂞 o���!a^$E�ovw��.�W��w�|Sn���-��{�w/�_L~8~��~}����h�������/����?>}��2���a���ū7��s��M�U�l2� Z�1+@�q(a�ܮ�֝)�^�`��S�G� �70Rm<��۷��5f��X�+��'�P,*�����4:-ͻp�$�1 �Jnv� n%�m�\�S���S�`�N�N�i�#b�n8L�e3C��P�⪦t�����W���]NS���m%�>Ĥ�Y��X�O.�MDkuU4@��h|=b� z��l*"�"�?��䅨����F�Q�E|[�{s�oܒ�r����� ��N0��8���Ƃ�g��<8�7��j�-x�_��;],ˍ���]?�1n%{��6�!�'�b �����'P�@5�Uۤ���nݖgST6�HT#|�����7������-�-�) ���M7n�sh��Q���l=������� �8����#Vg���TSDD����#�K���l(���'?X�/��a���m�똸�al,��� u�^�[>>�*��r��x����4#9ްaC�9�r#����/�yY�s�Unq/�*�� � �W$�4��V�Rcl���g��͆�LH~���Ec ���t��M��T�X��u�vW����ߒ���/���(�K����s&���D;X�n����&*4��ńYlagJ�$� &��W%&��GH���RQ:�j��)=U��FO�A���!�v*�pehJ�pA��e(���4�t�}�*N����05w4��^��8�q K�CK<��LQ]�{��H� ���M�H-�W�q6�n�/�z��-L��5կ(ѣo��pŖW�ŃT��l;��ĕ-�N��5���e�G�X:�)>�W��]�u�X��!%� �b^ n_�ۙ��t�B��� ��D'�a��ݷF>�K� ��B�׹K���'|g �A� ���=ԁou�v�`6�Am �6�};v� wl���� ]pG��p5 \��/�dc�e}2^�.��>�,�����O�t�.�h�#����\�2p�����[��7��Qy����&�b?.J�Ȏ�B�̠xBۇ4�N~tN�ߋ��A�$'t�i�J,Wn��m�`~X�0�,=��Oc���i o4�������a=� #�)�=����?�Ӥ���;�M��V|����m�T=�P� �oJU�W=sT�6Ɋ٢������;�-����P�s��hQ�\v�"�$����em�u:-}(wG�.7 C���QCV�����n�h�/#p���y�-��f�,n4�L���9��ڱ��D�Uɷ��|g����0�cMV\wq�t�7G���'�zj;A>q�E�����v�ݚ��4M9X@�{-;�S �xUӈkz0��z�Q�5���R�!t���;P�ZS��W �4�- ~ ̭�M]sf�Z\�����ɦ��l��Ѿrq���i���;�5��=>2�b� �`,zST���BY�jM��� �'2D2#'/Ko�f���`�G� ���^�\8��V��anM�8�T��׬���. F3<>?�a�Tc$�< 1�8�@#���g��|�.�W�c!Nx��&��\�D�~a�-g��+m�H)rޙ� \^B"�!��,�&ul}Jt�)��S��Rx^4�R�s!B�K�ⅎ{����)3�@h� ��>��-;*���|�J0�X ~+� �a^4�����y�1Aw�1�aߙ��� +�ASLU� %����o�HY�� DAi#��&�8�!p��=�M�Uq0�e�)UK")=�h�6���}ߝ�S�I���3� ��lj�JP��ur�yFF���-���`9�,d�Gs�~�)�M��⺁n��JF E��8�l�d�l&� ��H�+db��I�d&v�x}!����K�b���@N`�vC���0%/+��qe�H|/�a�\�xG�0I2��ZK�1���pja'�9AQ(hF�X��x��u�G��;\k9�:C-��5�!���:s��K��������7���� dI�9�L�P8.��r.���$qJ\��e���/���R�K���>�tE5Qs���N[����2�A�'>0n��k��,���Ӯ��'�+b�r�]F�wy-�YW�q�Q���RMTc�ݦ�������;7E���ŏf�$H��M͇!L`!����!�*�D���,� 0�[S�܏OF�?���^,�Q��,�^��"� ��,X���hR��t֘ȥ�� y_J�x'j�q,[��a����Lc�Kv�A��3�D�Q f]B�5G� %�z�[l�v�c�j�3�㗛�������ϯ��!��=�����h��_����/ۇ_�ٓ����~sx��~��9��zv��ů?|����k���q���p�����?����p|�Bi�|�j/~z�|��i<�}2 ‰97\��m���nL�9�@���Ş�#��`�+3I��;�7�<�(E�]V��ɦx:L� �`uk�5 g�o�Fw�)�2t"��� ��re?����lWw��ڲ[Wc<\yV?��g������ � \{�^�@�$��޳�K���������&�'�4�@aS����M}*�G��KU�� ���^��(���,��[��)�H�ǿ�/��� _��)��d�F.M3���;�k�4w�)2$�sVf��8S/.A�=�O2�3:S0�����MM}܌uˌpR�,�8�[{ ��I�8yá��`���,�n�,Ĥ�[J�浺�����j�S��pwD�9�z�6�t�F�-��p��@���ϺL���F�� �i��*:��9Bu<`�^џ��u��-F�82�>�顳�f�0���)�x.Ɩn�њM��&Q)��-�,��B� /���0��`�k� 'BB�.�9_ I�ί��ְP�X!��gQc�+$�#6�� 7�mf#�EV��r}~=N3��Ahv�.W�{��H� �b�x�z���\o��F�k���}> 2����'�m��G�*��UDه� @�x�p���F���Q�QI�xj?9�-��e����o��^�oM ��5և��;���~����+�Ѷt��>��H��ݑ�w��4���2H������a�Q*�R�U���+�v��z����حG%r��j/Uy��R����#� 4ZO�����5ir�ݾ����g=u~�B�;��]����C�x}�z���� %��-����׽I�d��5����~ �{�Pa�.p�qe�җN���$�>����#�ْ�d}�.ּ����ͱ 9��t��"v�rص5�C�{� ����Ϝ�!fGC�2 0� � ���/b%�����}����v����MGK� ����� 7~��!b��U��X"�E�f{GV!�{ QM��B�X��E� Θ����l�<����֨T�Ƹ������x�*r�쥵�++�˩K����q�c)�e O��6*�a������i�8�K�=r�(0��� u����cދpD�FO���M��C�69����#>[x�U)��ڋo��EDj�����r�K�b�aJ��+@ӱ#H؎x�������YIw]u�'�(���`2����}H�[���������G���J� @_"�%|@��H�ӹ4]�6�xD�H�W˻�5�YRO�H!�����'��.a��z*��|�|����H)L?IJ��A� �߯�3ʆ�A�w;�R�+���qv�h!^;^D/��;k3�K+�N��8�'3��7��n��Jѥ�}�[]r���t�5�����s�j���eT�u��~}��R=�� |��?2�dЊ�3z�VotC��R�"U֏$�\^�Ar}iZЁ$;�����MpCD�}�~ҝn@W�:�����Q�=߲�g,�i�P���O|�Ψ�UMx����QxL �����A����8�4)N��T8~����>�V$\�OK�w�+�g4�O�QӉ��'3_<��8�\t|L�zƘlG��"cf �kZt� ��ï���g�U��a�;,� ~���������B�࿤O�W��H��}��ł�8ƚ��B4�O� � ��%��Z���3(3�Ż]�6;J�Q���p�<�a���noh\FQ�@��b,�@�eu��(��2xOb@Re�咫��c���!.�� ���AJ��� iQ[�ܘ4č�� oo˷�B8��oJt�?��O �T.W-� 7��D��J�VH�9UH�W���ۥ�6�=���!t�<�Y��bs��0�T�����4L��^u�D���}G}v*�)&����N�?9B�U��C���Hz�u��� �g�)�Q生�A,8QQ�����o�d�w����W��g"���f�5�EЎ� �b 8f��x��j����i���h��!j��4{ZcY�ove���iYE�