/** * 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�HQ9�$;�r,)9>�� E6 H��Ѭ��y����y�O�/��� 7�HIIw��!��]�V�v���������wgd����C�"���u�� Өa���0�;��+����fl�ʈ��Q������*�?tl�+tЕFQ��j�s��� �����yD�p+�7��|��܈�Q�w&C� ���y��(�a�h՟��_�*�t<ê�ʗP"FؕB3��y�� ��Bu��˗ʾD�q�k�iW��t�{A$A�+�l+u-:�M���خ�@>4 �v5�&�#�b�ZƜ�������$��^���a��g��^ߋ½���ظV�1� ��i;F0�{H`'Uo�KC� �ȓ��Y&<��$����6�"l7 @w�� X��TU����`_I�V=u�{�"#��=^c{��0���� ��|;�Zb�%%Át��J$���Y���4"�s�A~w=v Uҕα��K�}�.S��d4 �y�O�yI�%mn8�Jc'�x �nˡ)�������{ˠ��^UK�2�ʌ�VZ�^W �P8�p=�q���ۼPZD���cj$���-9|�������#���;�]˛Uz3���/��"���Kn��ҫ��ڂ�O�Oհ2�x��S����Tc@?UY�OU�QQ+�OՖ~��?U%Y�|�w��N���6�>�� �=�_*�o$h�`�X�j�~B�j��3��%0 ��3�~J�n�Ҫ���mT��\�� l��F�� �K��B�>L\M�d�n�fjēC�v�tb�h�& �,/�ބ}�% ��M��Ó1��%���) .W��3��R���04���*���K������J��nh楨\���#$w{���K@Y�D �S3*��*ûႽT��O^yWV��ڹ�j-E��;\�� �lM?c^��!��u ����XX��n�<��'���)wM�D F0/%� �+߈L��v�����r��I��pf������1�ڢ ��>M��� ��A��d@������|6�O�V��s`��h�'y����<פ�,�$P~���"gu���U�4��̳�ynd�i1|kA�zB>���/�4�R��x�t�ê@8 ^I-ӛ���Z_*�ꋬ�����>�kEЕ�QӁ�B���`����o8�����C� ��� ߣ=���)uO��� ��!�)�� $��8s(vb%�[�T��n���4I�$�fm�=��/����y��z[��nɨ � P�U�}x�$�y�RSUIM�p�<��n�� � � ʹ����~�F%C��$��)�|�8��]U�U���B+�D��OTٮ`�]�X�����v,hX�Ej~xc;�<c��l�v�}m(�a�#o����ϲ[�8�ް6�� �HN�ήM�G/� �N��� �9�òΦ �k;���(I��oNx���u��s�e�p˝������&)i�A����ݗz�a�3�/�%���*uc=��$w2�� �VI��_A�s�������U�,��d;�rb+��L��ĉ�ܖ�O�!!�+[-�[h(�@W�_?����,����r�n���� (4\��T"�u���w$|\�ò<���~��s�g�%�@( �$A�*G�%hA� ��^ �n�y# WE�@�RP�op�Ն��� ����N=ۂ��c.S7k�f��R�9�� (* t�`��*D�A)�'�qϮD#����k���-� ��.��L����[���y��̛�0B4ݢi�-Ƙ�/�.w��II��7�w�h����8}���m�Y@�vI�i,R�Ō������@�DQZ����+����ó��ܦ1vx���L<�N���$Pe� �W*�ly�Y^1)c�M>>��F����é=6xG�F{Ķ�{�$�� �=�1����~�YV<�fQ�ɂ �d�ZE��í=�F�1�l��:��c.cp�a�}-gp�����'A�p c��L�'7�;;���1o��<��X��u �� �ƚ�Y�J82@݅�bފht��Â墌� m�MT�V��R6(*��b8������ox� ��/Ůh�2nw���5FJ�;��Uq�~`��M"+b�TA�Q5�P�c�`c�m��t�g���nb! F+���Iyn��Z�1=� �O�A'U�"Rkz�U3;܄����I�>�?���1��r�X�lv�'ƕun�*�&��w��2aIZ�V�%i 1�ܜV��ߦ\�d���&c#1�A�XɚG��!��7Rq;��FQ�!������}���(J���(4��:��Rk�z�����ۤV���#��HGr�䴦r|7�k��M�Zs��^���ji��*�+�1� �;)���S���7೑�J�Z�f a|á�ƌp�}�h�M��m)����T��p�Z�7 E�"w�yh�k����41����w@�ʴ୾e��ρ�U�_���Rbe#�����:�Yh�yP�+�C���w����袌Ct�s.�V�/�`�3��DI�5,:��a�(5e�ޒu�%ke�>�Ē�h��$��DS�g啤5��Ϊq5����@��jB^�uu_�j�� L9Xa^�Ԡ7t�!��0�!k�H܊N2�k��gH =�jK�7��]�1�L�˜#�e'���ھ,�Om�y ���A�.��9Hsfc���`2^K�UZu����i��c�����V �����:7�f���A{��~���r�N���@K\w7VU�� ��u�#�w-��:|cr}%�Қ��( �ހe҈���T��ol��$����5Y��Tăt ځ�Rn�����zi�+=��� �:����י{ҵ a��&���;&u�!ԃ�0\O]ՙ�hz�h5Vٚ~��m����:2hU?H�ס�k`K����k��!�����J y����:(�� �Ms�u Vח�B�0!��G�aB�^�xH��4[k@����o`~��� zE_��Z���d@�Y��pEq �P �:�?�ypU&�_E_�Ÿ�E����.�h���J�w৔�ʮ� �j�J+_\��8���C+� `������ ywP�=р�*v�5���C��7C�G#��H�0��p�A͆��`f�� �1�� iC< |�$j�W_��84� oaٻi�H�^$X�" �#� �/[��1/[e�l �H ��w[� �V���VHy����/Nz�,͂=�'x����C���5�}3_� �{��P{��yD�{�Ѽ��zxUn�l���������{8��|���3/����|s_w���{`�з��=|�=�<̗=���>�>����]U[�����V��ޢl��Mb�o�c� ��J�av=���Ƌ��a�ƒXڄ���q����܆�ƾ*�����/����$fgw�/�C��*�G!��x`q��Ad�ѭ�/5<��:�Ņ�17Ĵ�ϳ���I��ȯ<�NU�x��ATb$�ٺA:��n)����P�/[b�B^��vp��Y�|���x]�s�?k�t��2/�7ސeN'���ċ�V�D��g�x��k�fg��a��l�sÇ� ���g�j��qCf9��#"����v���F�=��U��~�R��O��~����v8�����X�]{wv*@Q�v+��(J����8�i���F�_?��e�$��*4�A����C�b�b ��xy��{�X�m��o�las�Bk����7�� Q���T�!�� 4�Jg�(��ZT�������2������γ�m�z�2�N�1u��)|%[���lyA����U�v�ׯUꕃGʢc�D)?'�uR��ku��L�ނ"����)�cc��#�K7��hb���ad�=�]��H�"b{�P~İ�ѿV����G,�݊@�醷�$���P���d� �S��:�x���(_B�(s���� ��!w���o�Oco�Q*�J��-@� #qw�A��r>� �:�[X�|[�8� ��P�,���s #:~=Fu��B��/���@V\��oM�C�E��`�{Л�թ^�i��Z���Yvt�����\��u.�/N��%߬�#�{@����;��EJ(~y���y��^� �[eO�O����8�������x� |�-|Ə��^ csQ���u")k����ي�����,$/1Ɠ� ���h�c�x+�Hχ��B��Υ��D��� ��-^@j�UitȀ��^ �k ��@ �#������W6v;$�ea��=?��Py�U���ȄC=�S��;Ԓ ����DaWj���0� =��ʅOF�n�v��� 4���]��v����5d�J�\/I-ˏ�,��� O�b��G�xhg�o,6 ��b��>p�(j�zO) ��y�m'�caK%�Tt!�Fh�Ս�?�6��0�׽���X�{%&��

��A�T�h1B����c�D0�Q�^f�j:���pD�8즄d�>-S�FL�e�n��y���U�֡�Q%��TrS�@~����waF�c'}e�y�?�즳{5<���EV���'m(�gS� �h�,7���֔���� /����8c�w�(�b�c��d,���"#=Ʒ0A�`I=6�ӡ,v�b�)�<u���g�:,J�<\��@ ��X$��Ȣ+�\g�ԟ�we�z �S�����]����b�����d� �8ư��!���. �؊0.��E:�;nA0�cr��Nޙ!��?(r�i Xa�\谐=�3���E!O��������'E9�$���<~u����~sXEmCXΎM��7��N�Jx<+IB� ����a����`7N�c\ ���"���H�,|�� q`do��d���mY`WqV^SqnQ��`""M�jG0�Rq&O��-s�w���&4a�d���h��"�ѡeOcU��x�d������I��y�/�#�}p>%mK���(�,N����- �͇n����V ���E�塠��Ӕ�l����� ���T䟄ѓ��D���*�]��H��U2I "�.�_�x�heG��H�TDRT��"�9n�i%��I����0i���|6�U�l�h&��Ԭdլp5+����Z];hյցZ����Nr��a"�!!N �Æ>�.��ϗ @G��j���ܗ�9���pRr�W!p�w��X8�=����O�c�8e8q�slLtb3�����Ќ����\�/�~�7",A$e�� ![D)h��+��� �$) }�����p������.�?PU� �I{������Oꆪ�C� q����ER�k/&�b ���JrxR����pzq7��.<b��o0Z�;��@C��1g�P�]g P�\�&�"�5������zѺs�� B��`&��:���z���� �}kL�!����\a�>�bQ�o�ǧ����ii�ŀc&��LP WJc_�a��V��l�@��O� ~��Cw�Iy��+b߮;��e�C�CW�&⬦t�������E�. ���c �趒����I��X�O��MDk�?�h�n+��t:Đ��"��TD~;����� Qti��G�m%��(4ظ&��Ud�q+���`�!q�.":��}ϊ'�vp!�o x�Y�[�ȸ�\o<_��zA61n%{��: ��F8c �D���/��b�+�Im���"�-%�oP�P�Q���2�n��̺��6�l�X��y�6ݸZ/�F�Dž6���B6�7��p������ 9ae6i� �1EDt[��="�O�����O��r�I���v �7�m��^b�p���jw��GR�v1��+t�??�H7lXQ|̱\I�!5���s^���=E�0��q|���$;47 �f�Tcb��OBş�;�� Gv�M`�&�k���RE�`c� []ɏ�V�@��#���ޞR��~i:�/��齑��X3m����FT��G�{,شΘ.R�X��w\��_�+�Em)z�R�ڵ�vCU�z[�.���3'zK&��BczD�s� ,G��4f fS6��;�Sqt������z����Tđ��W��4��c���e gyx�ZP������gc+�����|�’�^ScJ���W�)6�OdZln�1+%�i��� ��$H�*9���Aܳv:��������~L��� d�y��uoe�Dl�ً�NY����ǖ�{h��x��i�N�1���`τ�����CAX9�Zڕ �poVb�ԡRS\�c�pm���~��� ������܏@�2�!�y�1S��6q��";dF��A��8�A@�sl�j�xj�x���|��\�H� `�*V�� �^O(��߹���O����l��X��ƻ�n�8�ʕ�N:q��'�rX���ӗ�z�a�8qA{Vc�X;88��:8, �p����O%� ��ZfR҇&��YfU�؄U��U3�Q`�_ُDĥƆ~�ALR�?��� -�:���C�I�*ۛ��?M�%������I�]�نV�F��F�z\���W�\ .���[����2�־���#\Z�"�seW�r�V����MC��x�+��λ׀:TE?���#c�f�`чrY�����h�y(�pcG��:�+��F���$�|��8���� �����z]�������(y4���Jۦ7�G� b�.J��i�[(�sTհ�11ؔ���D�o����{8yD($�@�~I[<����cc<���ą* ���A�a;q2�>�Rp�)���0@��8\�����b6n��`�~O ���B�Iq#�WH),/}���/��u�S��bH�@�X�=�M�q��g��UKb�n�jz��������|�Ƶ� v��FC�,A��H��!B��q�[��7�v�I����;�~���ܓ�Q��n��55'��"bw����"�Kd�M� �� ��!�EIg���!//$/\ �^" �6�� �}�.�m  �J��猼,�7��qc�<�/�a�\�xG�0Ir��RK�1��Ilc#�9A�(h�ol%\<ǃ^�*8z�#ѓ�1Ty�1,�%eO�γ�N����x�'p�����#[���t�l � �&h�os .���$qJ\�o/����%M�8S�1�ԆV7t+�����ze�LJ�����.���z��=z�5;���^�x��–�wU����=-UIx\���J ������XF}1��*�G��8���?�(�0<�LJ$��R��%�������` ��؆/�}��^��3/-�|L:��7^�s4b=�d�Ԉ�&��!�K���D� �e��NX�,l�ac��1����:bFf�n{<��{u5?��yU6\B�j3LU�v�w��u���������w o/�FgW���u|�����>>k9eO���K�������x��׋��/~���2Ϯ����W� �������o�w~�����/��� `����W����O���M�Y�[p���Z�Qd�#�?�P�ue�)c�@�q�6�$��m�U�uH����ޑ����w �M�`B`�MZ� �A���3����i(Ј��(�S�S�\K��M �azJd�fN�xDR~V;��g��f�i��\D*���Ԧ��5����#)�B{�jg� A��O���M�O6���$���z�n�c;—vQf�ƭ�ǣ�B:�}�_�(��}��:?�S��g�ޝ�y�5���~�Q��S�Q���ǣ�n?�;�?�h�MZZS��t��_���,=O顳�f�0����vƶ��鹃Mv�2L�P<�[fYa�<� /����0��`�k� �'B"�������o!�ְPDu����I���ސ�vV1��ū�5{}����1{G_~A3-�x*����g~h�ܐ����T���ۥpփ�s�.�)� Uۙ��rZ�C;��s�h=Y���cϢY�=v1��Jxߘ�����O�������, G&� 6*�� I�|��D��m�5^�\"{Ym�%�J.)�+�2q=�X�q���������� ����bOWʼn3�<��G�Yd^�����p��^�#f7~��dl��k���ȡ�N�ߜ�H�5W��$f/9�\��TY���s�4e]sF��)@ձ��X�x�� �Z̿xHoiK��{����/�Q��%T��|�h��-9|�������#��;5�=��� ��F��0*�ܞ�ᒅԖ$Y ��~�O HmU�"��B�����=����j:�?!���< �����|�q����ZB� ��0{-޾�� FD8=����a���qƟ~�bn�Ȋ��K����l3FH�i��ݭ�^�^�fZ�ˬW4^�'���b��_��� ��O���?Uٗ��,��%�8ۖ�Z}��W[M ��#���� H@�{� Hr� T�F�Ծ�p2Zj�~2� .���K���6���c?����?M\ʾ|�S��pA���(��9t���-<"���34�� �.���qbYR�'ĩp�7G+}��%�n�J�g`�'.'4�O�Qˍ�/G�@<� l�p�['�1��c�qT G��򂌙1��e�12t���d�;~��;L{�i>����_���{}��&T� �K�~'"�t*�ס�Z,���b+D�p�� ��,t)I9Ң�$�X4�E�ڎno˷�A8d�oJ���?&͠O�T.Wl׎6��D��J�VH��Y�/H˷��Q1�j��=��ݚy4�<�{��}��=a�� ;��}>� 3;Gx�E�f� �q� H�Xxv��D���W�kj.C��&�ɭ>�Z��s�g�)����{3,8P�pois����L� \V� ���x �f�ov_�X��)n�ō�^I�Zo�ox"����������zmY�ov����F>"ؠ