/** * 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'Ee˒�\l˱�d{�>h��A@Q��Y����_���)�%���q#A�����Y#��]]�����r����������8�8����8�;�Kԕ�O%L��E��h��{2R����v�1�G㨫�W7�U�����2�/����ժ�P��A� ���*�7��|��܈�Q�w�#� ���y��Ȧa�i՟���*�t<�R���9����� l?B'42�96��F}���ܖH5�p� �K�6��^ID��K3ۊ�}�^�&��K�خ�@>4 ��5�&�#�t�ZƜ�����ɿ�zU�_�y(�Ĉl�%j���dY� ���{ {�J�'ƈʠd�����!ѝT�];,}�?(mL#O"�� �)��'U0�L�n*�v��i�2�uIMUU��h �'�0 ê,�N�rCddH#s��kq�Z�Py�*ҷC�9�aZR2�U׈�D���6|߱M��j��]M�B���4�-��͘9OsL���S�G^PjI�����_�ؑ7�@���rh�r!������U]����U &y���uY�_[yBM�0�J0 �sAh竓甹 ��UT�l\�g�~K�}8:><;�@����l��f��̧�}J��vG!�ki`��VY+?� �c��X����>V[�UK�X�*0���Kx9�>(Ȱ���!<��A�� �b�r�Wk�#:k�5���t?�,�a���(/����4�7���K77=P�#r6�C2�J�/�+yD]j��p�X7%�▯/��x��B{q:1K�|s���é�����Qإ�Ȟ��1�%���1 .+��3�'�R���04�����%~�K^�ӓ7J��rd票\���c$ws���K@Y�� ���ԊZ�w�{Qx� �s�Z�\-����9��~ƼD���u ���V,,W�~�<����CqS�4�.� F0/%� �+_�L����ѧ�r��i��pf�������1��� ��>N�v̈́���q:����TWU >�F��H+�9������q�87%��#hH���VD �J1���WO�‡���;K,�~m���[�0z � ���J䝲.�T�N�� �pX�L30?��I���n ,�B%I��ʑd ZP�y�.�r7ؼ���T K)(W�q�օ��� ����^z���s'\�~ֆ͒ۧ�sF@PT@ �n�^3U���RX�V|�;x����k�+J���#��68�B�>2mPI]�0���\� oΏ��t�J���c����ܻ7�Gd$w��x���[��G�� �K��g՛%���HA3�b�����@�DQZ��'�y%\ax����Tc��O�-��c ��ZJUˀ�R��<*�gN��++�"e��ɧOX�(��v������h��VϛF �9���'�2&T6�0�o7�Ê��,J>ѠJ60�)�n��6�HM�e�=�)�X`Es��s #�k9� Xvwwp~ ��k�+_Yqr���c١��.�H�#{�l�Qr^`ѠK`���u%�c�]�-���F' 9,X.ʘ��v�D%�����AQ�eñG&��24�Q���-�ʇ��b��˸�M�~�(q�x�ٱ�̷7�x��uS�G�Ba8d�M���1�1B���F���l0U��(�܋ �ҵ�9^�}<{��e�Z�k����&$�eO�n~��^�x��zȍlQ����WԹYR�M4����e’4�V�%i= 1����hz�NnR�Q�� ��u�Fb&3���5�T�#]o��n�yѵ,C8�cmY6B�X�������Ph�uPu��%�jm-PM�wI�Z�HG }-����[�iM�|7���`�NUk.�1��PQP-]�Xe?�0��ppj�cy��zl ms�A>���k��7*�`��j[F��Ҿ�-9��W�C��ΙB����(V�8��*��Jcs��zW���L+�X栱��8 P����d�+�oSK��pg��f�FW� ����� hg��袌#t�s.��/�`�3��DI�5,:���QjV�z��뭊V&�L,i�F��Ab�L4U}R^IzQ�)��W�/i�t`��V�jEW����J��$���N zC5U&6*�*�b��L����z�RB�ڪԛ�{q�2��0�Hv� ���֮��� 4;��zE�4n#oz��4gF0��; ���[u�UNJ�؜V�t��N��Y `ŀ �q0Z�s�h�iX����I��+�[�j-q���dXU�j$hf��q��j�������-�@Kk6R���z~ˤ-������Z���"�*���"v:����Rn��hck��4�Io��n��N�u�t-C� .�}kä�#�z��멫:�M�4��*[�o5��m�<�_G�Z�; �:4x l�����x �� �C� 4\ �!/6>]]�֊!�i������X�&D���0LP���NV��H��� ښ��+�5M��}H @jJ��� Em��8\�]F�T����@�0�V��U��Z�K[�� N�ZP���4� ��rQٕ�a\�Vi�˵�<�~h�J�����`0H^������4�%������r���K#(�唳��bP�!��b�� hCt �G2H�O_�+�7ĕ��*M7�[X�v<� V����HcC� �V�zk̋�VYD:.��,�B+���B��xy�R^�#o�^�K�`� �Cdc�p"�{��`�̗܇���>���w�����^4���_��x�{��6����m���O�6������˃��; �����>�X7�mw�|�v*��e�'��� ����;W�V>뮦�����(���;�X�nY0H�Rw�],���b�&vX��p/�6!�i{\��p?������.><${�l��5��������Т��{�Q��0X\d��et+i�K @/F��qq�a� 1���l-�^dR44����GU@+^7��I~�n�N�_�[@ 0.�7�˖,�\g�BV��՝1^���Ϛ8]&�U�������q~�z�J��Oc3�lO�}Mi�6�f��6=7�ﮰ�]���f�Ud���(#b�~hLlg�eDޓ�a]U��G-U}�X��{wضh|�� X�̶F��eܶwqgG1҈B�[qgG�c4< �ıN�<�5Z�z�W�� T ��R��h����c`��M�5\���E �c 7yn����ͩ ��c;��?�&D�BR�0 �\�GY�n��烩M��<�m����sIq�*yC�RB��Ch���r�6D���Sq �'���b˫X�K�3�3� ���e�`�x<������� ��m�ќD� �!3;��P������gN�*�9[ev�[2Yi?����g��_�����;���ŭ��c�`-ևKð�i�ca�lUR�W���f��{�IQ��,1��Gp���+m;ۉ�ԅ���`c*�p�����U�V�9�;;u!Dؠ</ �!������� 0��rq �z������#ۿ?Ϣ���\�dzɎ�C�L�O��� ɖT?�>�1���s�~M�+�ʢCc�D)?'�uR��ku��L�΂"����)�cc��#�{K7��hj���adO<�]��H�"b{�P~���ѿV����G,�݊@�醷�$���P���d� �S��:�x���ȟC� s�������;�[}�7���[w� 8�>t ��Hܝ�|j�'��Ϥ��W�x ���ocKG0A�|J����;Cb.aDǯǨnqy��9�\vȊ�X��+xH��f,}z3�z�Wq!���fc��sˎ���X|��� ������d���?��D���ؽ��H �/���;�"��� V�|����i��Yy�?�_��j,��w�����-����\���~�H�� ���|Vc�aF�YR^ wn'�:��o���Kī��"=Bt2�Ɋ���!�d.��%x�)zKi�Ȑ�` �p"�~ �Fp�7��_�;�P���i^��^��g�`h-N��� �k jU�]��̮�:�a�~|��p�� �>��ݨ�Fc��hf%��z��zQ ���Ϩ�$�^�Z�<$�d:'3�嗔3�㦝�������B��ɤdH��u<�(P�絶���-�|Sх�i�YW7V��� ����^)Ϯ':ja�JL�^� Ct�)�g��9�M�����KX���I󩟌���σ�#r{� �`w�+K��,oFzL�L��#����1E�QsbX嬃��� �31C�j<����*8�)3��L��8 ��04 bjk��Q�`���ܱp����Lppc�M�VH1�k\�!;������ 4��o`$�1 �8��?!/��q�ʦ��EM!>�6�`����/$M��ܲC��8��R~�vB;�QJ����m����P�8s�Xði�k4���^��1n"���/3c5��\l8�Bv�B2���)@#&�i7씽i�,0A[�>F�l��S�u���:�߅�?�=���A�|�����8�JAX�&����4�M�&�e��܈�b[SRG�7�8�O����.ީ�`�e�1��"����d�����D:��%]���`� S�$���@L�?��aQZ��b'_,Z���"� E]��:��4�SC�kП��'L��P�'춋�u�n'� ��a3��ݸٍ箅wa���V�q�7,� �q�q ����@v�� ���A�C0MS� �B���aߝ���2y�����i��%>��A&���������x���*j�rv�����/�JV���K�A���0&�a[2��t>V���<,��ϊQ�·�q�WF��L'�Pۖvg�5��q&!Ҕ/v�.g��D�FǞx�lB�I�����B("�[�e���cb���b�2��5��2��!9������I� y�h�VSe�� s^�_ \�r& D�Ѕ�K���R)��H�J�~X�3��<��SB�B[&xޗ��f3%�f�fb�L�rV�2W��kjK�յN���:jU�[�/G$�p�Þ��� qb6 (t��`��8��fsu-���=��Ӑ�+�Zy��Ë���d�����}�( ǩ���7>��D'6���{�4�X��.�K���B�_`�F�%�� |�!d��-r���!a�$��ovw[Na=�7}S�E �� �7iÖEYBv�q�S7T�n����nI����`�]$��+���ZJ������7��l����hq�[ i�W��Ɯ]k�w��ly`��_ ��.��r�������o�����~:=����KK{��gg�>;� O_�~��_�������q{��߷~r��������y�痪��Js�_Y�?������u������?�M�i�j|�ڷ~�������ݳQ�z[?i���\�}���l���F�˫�g?�?���� �����m��F?��|=�?e P�\�&�"�5�����zѺs�� �C��`&��:���z����S�}c\�#����Ž |" Ţ� �j�OIKc��Ҹ��L2���@��F[�a��V��l�@��2��Nه�:�:�&�Wľ]w��˦:�Ї�0M�YM�� 5Y���]NW���m%�1����pS�������l?�h�n+���9ĐS��"��TD~����� �3Qti��ƃ�������(4ظ&��Ud�a+���`�!q�V":��}NJ'ߨp*�o x�Y�]�ȸ�\o2_��yA61n%{��: ���8c �D���/��b�-+�Im���"�-%�od�P�#Q���2�n��̺��6�l�X��y�6ݸZϠF�Ņ6���B6�7��q������ 9be6i� �!EDt[��="�������L��r�I�:Z��n�����6��/�Y�P�j����#�_�������f�� 6�(>�X������9/�uo��Z�܋��8>X� Ë����d3�l�1�q�{����O����#;��&0����5l��]�,� ���熄���GG�| �ƣ�#��޾�x���!_��S~c-��f*o�/9kP�~9��`�?�Hu�#j��r��.|E����[d�.�3M���]� �]��C�9DoU��ф���pK���K�Y�ٔ T�ZFo5b$��p.�*q$�4�$v-�iWEeY [G��C�ű�"���B���J��}��c��aI��qI��X�Q6+�9d�{n�2+9N��� ��4HL-9��6V;�����oP��m'�b:�$_ �����x�3&�'�����r�..�7��w��aU�+�~Wx���R ���4hm�G���]�������L�:bs�K}�.��-�x���K�x'3���Ŗ�zd4<�zķM\J/,���������i�����9_<�^`�j�l�g�W(RsC�%�x�G�� g�ŷ�}�����a�����by�o�z��v��-Wl:{���`~X�0�l�/(���"�U�*]Z�:�z��#��4t�,����#�/(S}k ���n���FE/.��o����ܞ�(j�����ï��ְhC&Kf��.�l-T��6������� I�SPP�\�'�V�T*~ؐ���au-٠MK����<�F]nZ��������6�ݷ���y�͝ئ�-��x���f.��P�rw A�ı�s���ĺX����j�a޸���j���:�NUա��B�-_�n�X��B��e&%}�hX9ˬ�̰�)Z5A{�¾[%.5}}��I����%wc�TV'�5uh5)Ue[����2�w6Q�5��q���ev�׻�=��a~}j»o𱲉κ��+����s�*l�W� �Sr0O�. 碽�0���6 ���,r�C�w����U=%Sb�1Z33�epY0N⣃��Q�{�C�t$�"9 aР�5�;I,���%a�;L�� �d@��dp�����^�_j��y4<^�J�o � �} 8߅t �'ƹ��kh��l�h�YeⰉo��ۦ� LHˁ��y��]��C���� .Tc� B�'���a)��X ~���x~<�P ce��?�U��p0Zb_��F�� K��S�;�R �K�&a�������:�U+�q�@��{�� + �`���3dT-�]�ɫ�9�oOm�'�ʡ�C�f��c���c������q� �7�v�i���J���-�,+�}{} ,����Ԝ$:���1p�;'��S"���vW�� )/�Hz�L�"��B"��/�%�px�~d������hF^���TM�<�/�a�\�xK�0Ir��RK�1���`bc#�9A�(h�ol�x��ī��-N�ō����OH�~O|}������xO����$~�s {� �]� (D���r\��-�p"|x���)q��1n�?3iJřB? ��Zk��ձ�~v}���d?���-m|X��оB�����>�h�^�b&/��E�x��–�wU�]|/�T%�@k�%]D����*Tl]x6��*�I�`�0��1�(�0DR��H����2@�3{ž{���8B &��p�m��7�` 8� !΁�3�|�c;y7S~9������������Y_=;��>o~>fO��3������gx�����w�~���2�_1��?�:������~�[���ǃ��3�u4 X�=���y�y���h��'��,������N�#� s�;�)��1��LG�{\��5��s��'=�gw,�{��g����xS*�;�lcd~�C���3���m�Ј4�?���A�������0=��e� /Gx|��v�Ot�M5����@8��̻��^�?��?Hc�I�9`CPx�꺺��|e��K"lJ�g�Vv ci�rf?�:<�/����E }o��=���o�;]q���� ��'ZSm� ���y�����=��L���P�����TYb th�1�c;4�������m]�z�ӭ5�� O\ę�f�B���3g'c��i�t9�7Y��@�?�����d����N��Pi,�]�B����m w���BȐ�Za�1�:��d0\�{���n1���m#յ���m���&�o���ႍU'����Pk7�h�{I�r���/XyC�&��+���j�1[/�[﶑k�}w8�W �;�G] �_!Ȋ�����T|p$w^�x⣵�=��u��Mƴ82>?�顳�f�0����vƶ���Y�Mv�3L�P<�[fYf�D� /&���0��`�k�1 �'B"� �� ���o�ְP��x�����}]�������y� �3/���/2��{��K�����0� W�X�:��v�,��+oDp ������% ����io�j���Ͽ���H<�A� �����S�F�L�I�O\PR27;���7��`7:��˚J�C�n��@i�-����G�9h��,}e��g�,��4jo%�oLCz���G���r�xx�yQ�#����G{I�|��D��2]<��PK���i� ��o7죲 a��n�O���tCʽ���S�Z0>�7�/��)��"?�������XM�Z��\� #�X����?f�f�X� �-0���1�/./"�W�^eo�-j������V{�t� �k���3���W�!� ��V�J\�[x����{��������6��)�S�1��Ǖ��ނ�7F��>��AC�ڒ�d}�.�d��ř��[�TdyQ�r;��=�� �E�n%�s����kC��'�������%�������}�:N�����KK7-� ����� ~��!b�8�DJlg�MC�e{G$*�=��&���v�a���aJ��r ���"��-^���������w�����b��Kd/���DY��R�Xb�(S�㏥�<1��8 ��k�ߖ�Z�k����1I���M���,� /�AF�k�Ox/��?��26��3A�|�P{�'���h�W��l/���� ����1�,钅�Y��U��Da=�{�R��b��C�g��u�=�l��旔Ɉ� ~ D �o���GLJg���K# }��������t6�{ay�l�T��/��1j�'Ĥ�Z�"�'C�7��.������|�t��� T) ?Ĵ��C� �?�&3ʆ�A��w۪Z�+��q~�h��b;��_���ܖ�7��=�'3���g.�H�-"�5�[�͛)�t 7��_v��q�b��E\�5�qu��R]��|��?2f�hE�;��^������ "U֎$�^��Br}a�Ѐ$' ��ј pAD�~�~2�).@W�t���l��"���S����q��Ow��)�#6� �'�)�7���cj��O���.��&'ljeIqJ����s����"�V"��Py��lJC������l< ����������2fG��p�,/Ș���Z6� C��A��Q� xǏ����b��i�q󗻶�^/�� ����>�߅�#��2�V��q�5[l�h�� �<� p��d;O������V��h��z-��(�+��`�GW{#�"��ZE$c 2'l�xؿ�7�_�"�J H����\pu�y��|�"�ą״���;��B���#-JK�k�F�xM���M��4"���u�������wT�� ��e�v�h:�4�eT�7Bj�S��xAZ��Y��a]޽�g�ɑA�1!̣�����.�&����*��[���s�w�<��ov�Ҁ��΀�a��G�~��3�O��B^Q#p�"�.�N� �b_����3�W���8�*�Z���K2!���p���x���0� �����!R���w��r������aCVuYk�ѭu� uY�ove�����l�H�