/** * 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��Y����_���)�%���q%H����9kG�������W<{t|rt��d͜��g��8�;Hԕ�O%L��E���¡�l�8�����SjO�Q_�n��y�3�v��i@�iE~د�=�����h8ZD4� W1�Y�җMύ��}g>�ݰ~ِ#/2�4�)���Q�sXG��gX �U>�1���G��F1�F�h ��������1��¦��D$ҥmEӁE/l���Fl׎l ��CG�w:w-cANͩ�9�_�^��Z��<7Kl/�F^�%��fƕlό �A �J�1� �C�;�r�vX�ڿSϘG�D�O5�S�O�aZ�\3�T��Fh�6e듆����Z�OR5@�UN@�����ȘF�t���^�>��2� T�o�XG�ô�d8P�Q�D �j��c�Fd{n=�o�fd�J� V=y�uO�e*�M�9%O㷹�O^RjI������_�ؑ7�A���rh�r!���yg tUo�U����!� -1�:��*�4\�A�$�i�.�ѫ��ٸ0P��<{����������{i��w� /}:�>ۧ4�lw���FFH�G� �>�?�C�R���:k��G���~����ZKQ���zG����RM���x /&w�6���#�'|��f�Կ����Y�b9���������B��C��0�PG�N��  �JGѥ��}P�#r6�C2�J�/:yB]j��x�h���V�/��x��F��tbVh�: ,/\�s}� ��Ok�=�'c��+.�$ǀ��\Μ��+՛���!�9��Ԧ�7���x�NO�*!���=^T�j��bN���MBޯ d�*&���fTQkj � �E�^>y�]X@j� ���Z�� ���`�a� U&��)�nl�Z��Z �{��2�j�Mu?���TS�c��6��M�(i��/ "����6L�=7>��T��j����)�J�Q���#��(����T��H2էO9k��QS��f��y�3ϭ�3-��$i&�3��})���Bo����� ���u���B0��h������Ȫ� ZZ��ֱQ �4�.�'�葽1�� ����� ���|��iH�1�S��]��[����8��3� D/5]�}[�dp/�XE�,Uk� @�?�� ��[R����{U_��9�;��#��Z�CA��$詰��|�f(� �������!xP�$����04�>����iU�� �TO�sDZĽ說������?Rk��A�Qu����Xаn���.�fvʭx��/���)���T x�� ��Ts���5k��ʀ�j�ۋ+���K(���Q��Ŝ lŰ� �k;����H�'o�x���t��s �e�pÝ�����$)i�A����W =�$������>�[���@C�;��h�IS���W��<�@|�V�]U4K��l�VMl%���b�8w�� c�4$�ye+�%y��Rt���ӧ�KX� �%�A?��XM�-�^�E��+�7c%�NY�[�~#A‡B/Vk� L�ϼ|R>{�[ ��PI�r$Y�T�F�K�� 6o䪨��R ��kf����y+��?m��mA����i��a�����A�[��L"���5���DS���� k����� ���_�6���nP���i�|�7�G`�h�e%��[�1�/���ߣ 2 ��;@o�<��-��#�qF��%�ֳ��͒Z�X�$�m9��Q)�z�P�����n^���F����>U����Sp �ⱂp� -%���e��J��M�J60h(�n��6�Hͨe�=�)�`Es��s #�k9�,��;8�E��55���8���ٱ��w�E�p$�=� 6�hrG^`ѠO`���u%�S�]�-櫈Fg�,�ě`b�}�UQ;K٠�������Ue��$����r�C_�]1��e��&37k��8r<��أ�ۛD �G�`&�m�aF�� ,��(��o���K�  ��g#d����) � �� ��˾�^'��e�ǔ|�!Ä��b���ā���I�jiM���ʋ�� ��-��)zk���qYej�|���[1"&FPY=ʩf'8�bP�!�b��l�!:[�#$m�'�/��D��J�Kp�����--{; �߉+ZF�8��{��J]o��Xl�E��-�")���m�J���୐�"%y�/Nz]/͂=�'�����}���5�}3_r �{��P���y@�{�{Ѽ���Un��m����������?��|���3/���|s_w���;`�з��|���ϗݟ��>�.����\U[�����V��΢l��Lb�o�e� ��J�av=���Ƌ��a�½Xڄ���q����܆�ƾ*���애/����$�gg��/�C˖*��G)��x���p/���VҌ��^�j� ���ØbZ���Z½ȤhJh�W �E'���V�np/*1��l� �ؿN���`,�7��˖,�\g�BV��՝1^����Ϛ8]&��� �7d�ӹ��6�"��4џ�f��6�d�����ls�e�S�����b�\-&Y�n��磹���<�m����sAq�*yK�RB��Ch���� m� M���*Ob�ŖW����g�)f4A ��R��p�4$x1c5��ɋ+$��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&��!������K J0�����^�_ dps�o��ߟg����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ǯǨoqM��9�\vȊ�T�})xH��^,}z�~�B��4BXo6���������"+w�����-�C��7� ��� ñ{/f#j� �_]%�7E�;�������ӷ����0�����@&��T�S�]/�����:��� ��}��L�� fF4`֑�c���_���3��q�x�U��C؍à;Y��["����%[�/ E�(�}2�������~4N�¨,�f�0�����}���0� á@��M=K� G�pj�BC�S�9Ԫ|�Q��.�:��ó�*,��+~�0Bv��Meo,�AU�o�վ�EȎ��V��zIj���Ȓ)��Д_Vzt���vv���¯ � �'��a��7�@����v�?�T�ME�o��vS�X��*`cl�S@z�<���|��+1�x݁ çd�tsz�_}%��%��$��gG7(���9����G��A��.�W�2�5Y�`���9I}�df��PJ],G͉a���H��6��Ĭk��d�fW�9L�@^f��‰�/|��UT:G�E�n\�¹K��0Q��M=6i[#��q!��F� ��*�������x(�㸁� �x ���U6}��j 񡍰�����4w2r�G��J��� �PF)1�&��2��c��l|b 㶩��,b�~xY�Ǹ�`�-���̌�tNs�� q�- �D}Z���X˦ݰ���c�+��C #J6��亄���p��oa6�c�#y�y�?_�3{ <���"����6����@��U�QQ�`kJ��W����V�*���=9 V,�`�>���W;d��� �� �4d�;*�b,��SQ������ò���L�T��V��"���s��Rߓ�� �OS�&�h��v���:g���xq(�ak?�Cv��h�]����a,��" G�� �9�d'��[��9�4�0`.tX��ݙn��#Y&���?����'Y>�$��:;|u����~���چ���b7o����U�xF��`A���?̆ ��-�q:���vY�gE��e���W�+#{� �Q(Om�����s��8��i�;�u]�Y ���b��|�&�r�쳺��_$oQ �88M��&�N^�ݐ�B�AOE� �^����h�N[e�� s^�_ \�r& D�Ѕ�K�����R)��H�J�~X�3��<���<�B[&yޗ�_^^*q6S4[fj��j���e]S;z���:M��S�ް}1!��S�l�$DH����aD�˶F�%P�����k9��x�o�~6)��+�����lQ,\�F[ �n��Ei��8N^L��96&:���E��Dh� �t^X.7 �?���KI�2C��KZ&� |��C��wS_�³!FJ��������U���~�������v�?�� ��r����σ�_�/z���pz���W���͏�D}~|��j���/?����۫����b����96.�C����_���+����}m���j�j���k_������hvN��ӳ7���￞;���{6iY�'���{맋w/~q�O�;~��}y�������__�� �G���ѯ������M�~�x��r�-:@�s0��V���p�PwJX8��u璹%-��NK�.3��g���[]5���[i>���!>e2�%���u&u�Ͳ��}��0ӗ�t �]a������w@j �R��,���)��Jc�� ��b"<97��}P��V���t�!���E�����N��������&�v���m%��Qh�qM���7����Vdg;��Cb�� ©�ˢ��X���8� ��ɩ(����v�v�#��s��bYn�t��ĸ��1��8�"��1���¿�b��w��&��|Pw�趔8�9eCA�D1���iz3�~�v�޲�b�B�S�t�j=�}�H��� ��NH��>ŝ��2��e�+�Icmi)"��J�o�xj6�Jx2�w6���&u��=h��&�o�� G��f�BCk4n����J|m1��+t�?�H6lXQ|̱\I�!5���s^���>EU�܋��8>(�`�����MB��E6՘�8�}��P��#���8��N�� ��|6r �!qW*g�ak+��Q�G�6-������藦�R�4�ڛj��5Sv�>$6ՠ��<�]�&tf���Co�N�q�|E���[SdU��֙��[�~� �}:�t�qEo"S���f��[W�"_f��̦l��w���x�Q #Q��ch�u��#��$�_h��L[)+�Z���ȵ��s��=��%��gc+�n���c�XaI��qA��+��S�g 2�5�֘����y˶�ݖ�?\�m8�u��:�Y�^[ Br_��wk�b�~ =�M�p�;k���N"bZ� �p(�m!�m��>n4e�m�/�P�MCYWtŷ�e;�X2���쳅+������� �y� � 1 � Q��L�4�o ��4�F�v�fO���ْ��f[�i�%�֨c�L����ݶm���%Ι%ma��+���ż��9�L��Ks��5��꾻N�_�X�)�]\A{X�����j�a޸D|q�`�K��z(���!� ��d7|,�v^�2��>�V�2�B���)Z=Ac��>����.�؎Ã�����X�y�ܡ��T��Da���0��<��|zo���e���w#{lC�xŖ��4�J$��V�!�Q"��X6p� �"F�r���e��r]tI���h �Ղ�Z��e��4mPx�.�y�Ș�Y�������vX��*�f���2r����M�w��f >�K����'pGW�w���8ޥ�؅�s�<ޫs=m�S�=�֎s H�0�B5������̈�f�7w����Дo��[Sy�+��@�~IW<��. ��`-cV1� &�>��@�v�d�m�y1���!���ʈ�(��XP)�]�3i6�]�V�X��DN��t��Cp��'}�������I�$��%�����pe;T��b���ɰ� �1l�8�jI�DN^M�48�x����̸r�;����j�p ��c���AfN�8�-��\����?\9��[�!Q"�;e ,���6Ԝ$:��;��Sߡ�l"�[�vW�� )/�Hz�L�"��B"��/�%�`L*��m� �@���|`���%�BG8.��4���o�&I�UVj�?�W8�ll$�2'(���-���x,/^G�p�}7�z"?Y�C�=��j��!�x��xO���1;?������� �&h�osN��R�8%�q0y�v�IS*���t����vzݸ:V���UN����2�m�����W6�-������O}W��p���ۼ������(h�9j�J�� u�����f���e��E�<�|�U!)�*~��0��I�# 9 �T#U�R(�pf���~r ,�E��<�b�D��6�A�(A���L�,�P�=�uf��*$6��v��/����N9�-6qa��FP؎�� C�i�nq��\��Y� ɞM�$��T�e�(�P��I?��>�T���>~˺ݬ�???y���j������������&��|v��=|�9�|̞���gΛ�������ϧ�����g�c��b�o~���{�s���������99T�G���j�h�Z{����֋����d0H�Y�����^�#� s�;�9��&��怦�=��>�D߹���}�KfwӀ{��g���iS��;�e��A�8>xK/�wwp aK�F�)���@OmOr ,M�75p���-�ex1�c��'�#x|��l��O��g ,P|�p��w!���H � ��'�� A��O���M�O6���$¦�z�nd;ݗv�f������f!���/b�{�~�i�0*�M�s �N�<��j��(�0hy+��(�M ���Sw���?�p�O:Z[ntt��m6Eq�����\|�o��B�.͑��R����I�Y�P����{Yb th�V�c;4��3���㮮i���o��� oۈ35͸��sg�N�'�0J�r�o=R�\ ������b2|�og�d��4 {�۔ӳ�-�ηB��L� Ì�g&����sv�zv_&�<[�UO�v����6pR�,�� �%�%��8-DN9yá�.�k�CD�r��j���gD-j�]�eb5�)��'_m@��rm��i���ۄsu%r��|�e�`�5��X�.� [ޠ����3��]���g�kMl0�ő���xN��63��HD��(���3� ��L�Sl�s�a���2�2�H& y1� e�ŀa4C\�NY0�8�w/�LH�w~� ������ 1�<�+���\�ɶ�pp��2��Pd�(�o��a&�"?��NP�S#c��%��A�-ƌ/Ww����/�5C�x��ao�w�̫���� p�h��5a��,{�����x����ҽ3ET��+���� �\.�� +_d�����d׸@ka��,�>Du����Y��ބ�6]1+j0Y�`��+q� W��|� ʹB� R�߂�|<�\������dn� ٍY8��n�9e��T�5���L�1��ZZ�A;��s�h=Y���3ϢY�=v���Jxߘ�������o����iQ�#�����'I�|��D���}�c� �_�l�˱e��v��SUk�nCk�{�RE��#�7I�L��'%��4�������/��Ñ �� ~���]K�KO:��5�>���J\�Zz����{�½�xUgr�C������I�]���Aeo��vIrg@ߠ!�ْ�d}�.�d��ř�P(H*��(�@����vvW�h��V7�����s�d�[b!n���2y��BL��Y|w�����Cǩ�Y��f�6�!�ؕ42<����q�cΒ.Xx��%i Pu�� �#�j&�k�m-�_<�}V�\W����m~��x���^@R��<{��������p}a��=��ϵD����ܡ���#RM ���c�O�H}�&E�O�8�co� ������|�t����') ?Ĵ��C� �?�'3ʆ�A��w��Z�+��q~�h���9Y�����K+n��op�Of��/��\�ړ��뫷��4Sx��bh/�_�8x��(6���fb|6��8/՗X0nX���:�#c&��$�C�/�f�9R;m !Re�H������eC��(�.FS6T���A��pqw=����� ���I�~`;�S����q��Ow��)�#6� �'�)����cj��O��.��&'ljeIqJ����s����&�V"� ��<�p6�!��Zn�|6���e`�S�, ���2fG��p�,/Ș���Z6�!C�o@��&���j�;L{�i>�����ܵ��Z��M����� ��Q�(����Z,���b+D @?���<�!��z��'`PVris��ku�v���o����|p �GW{#sG �&�1��s;\�;Ň����j�(�-C��~2�U�YD�q�5`p}�NϱХ"�H��R�ڢ.^�~tsS�1��!�z]��$�1��x2H�jU�];ڀ�# �1*�!5�Br� ���,�̰.�^�Z7�ȋ�٘�Q�I��� ��Tس:ޕ�[���s���<��v�рE�΀�a��G�~i�3�O��B^S#p� "�>�N�� �b�`|��kTN�ĂM���v��%����.\�����L �f��v_�X��)���ݻ^��Zo�o$>�u������/K�ծ,�?d�O�(�