/** * 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�Le˒�\l˱�dg�h��A@]����?�Ӽ�����)�K���q%H���3g�(�tW׭����x�������w/�4��{���qMo2����K�FM��=��+��9���^]�O�Rg2�zpy��󟹎��LC:J�8�A�����N�AH��ULC��T˟5.��zq#p�NjM%�c�U,Ӛ�F05>G �����]�s$3J�:A�<�hlkj������K�'�F��3:��z�a,Ar(]8v<��ܱ��^d�xN���2]:�9�؉A��sץ�㑱��g�W2y��و�����Ќ���� ��G;)静y�83sBP �6p�pBw��V���>DΟ�5�/�Lx���I2���5�mB�8^�&KA�ij�\����UdXe����^���ilMwx��4c��ߟ@N�u�8�JJ� ��1�H|��� pˌ�k�Q���̅,T�P:BS /�Ȼ�1���<���ih�1�w�KJmi}3xC�+;�g3��hS-Q�/du=k��DX��� �h�%()��x��btZ)�ez���_�0��}�PoL/��g��L=H�[��ч��������������zvЙ��9�1��DdH�����Е�ۏ���H�P�p���t�*<���dž�V5����5.��dž$K��Wo/���n�� �_p����>X���0#V���~?�Sv<˝�H�s�ꌂ�� N�aG���ts� *|DN�NDƎK �E�L�GC��F�>�= ����^��� �/G2�M҉U���8�by��:��OhG*�� ��Y0�y��zn�sz4��ov#E��8�CP� ��� |͗:>z�F�'�����7�k��nnR�A h kT�@��=��&k2��؋�{���w�uH����Z �Z}� �\��Cn�ah^ը:��N�wsԪ �u9�����x����nH�y�X�`W��^A}�k�I��a�!�tS�}T��G- ~[�n���=�sϴ�[������R����B ����*N��ANR��N���>�*�F"�~#0�Y���Z�F%��t�x��<�G���7?�B�W�?2�c��ӧu��A{��J��ў��c��z�Pk����� �� ^�;���-Y���0D�?�X �dؒ|}m�=��/C���ݫ�#��.�Ú�"�sP�\�}��$�*FGC��i�i@`��D7i��/ �͵�����~�5S��$��)�|�8�]U}7V���BUP"x�G����5P�>�:� �J��B�D�ܚ�o�"߹s_Ir4��[�,����G�k���)���ۋK��K(���)�~�bA�j���s����CԤã7<8~ q>� ���ދ�j���kY��� Ӕ���C���J=�$���9��>�[����@C�7�8"����询�y������z�hP��N���J>5�9%>B��c�4$�yi+�y��R t���ӧ�KX��%VA?��X��-~�E��k�wc5��Y�[�'A‡R/��yFr/��Ͼ����,T�= �I֠����`!���捀\� Yja]��a�Z��������{�;64~ߛq��y�jސ��DAP1��{�U!��k�<��;x�O�Wh�+j���#��58�B�~�ڠ�5�ae�ӧ��2oΏ��t�Jd��c�_�]߽7�G9d$w���j�H��L��֗|[�j7 j�b��,f�����Q��EIXh����Ws���1�g�{}@U1vx��…x�!�xCKI��`�V�#���9:���d(RLj�|����5����W;l�M)�w�cw�y "YS�� (cF+����f�5�x�ȣ�� *�d�������k��Ԍڎ9���iV�1��18�0���3X²�����PP$��X���ʊ����-ۉ׼����J��K�+����t�g�Q�G�o}Q\g����&���n���Q@(����i�1�&�a�f��Y�hױ�5�j*�hǾwv�Z��|�����n�xE�6�f�i�rRB�v�Ѡ?��n�x��v�Ŧ0pg�8<1�,�s��v:h��%�j��L�v1��x��m:�ɸF���8��9I�� R�J�<2MOXt������׊ ��!��Ō�cFFQ�?�fH�Y쮂j)�i5�+��Jk@���-@+� $g�BN�(}�������z��t�@EA� �c��T�XW��s'�*���cs4�Ye��ԉA�X�X��0��R%cF�n�6��p�ιc+!���Ԡ�p�Z�?�D�"o�y����U*cb(�E���"�]A�2�xwd[��*� �0@�ze�+%Q6rߣ�>�V��Ck�~�.����E����Ӳ�t�s.�V�/`�3ôDMo�m:���Ȭud�Օ �+�u�=�Ě�n�=[u�kړ�R�e g��j\N��ЁvOK�k���d���J��$��%�J F�ڲ��۲��čX�$3m�&��~��Ѓ�u�V��F�̴*�+$��VT�������:}PHK�����[��"� 3�)̝���J���ja��lN�u��_'F^X1��V���Z�<:I����^�Z=�{��@M�%��ۛ �*C�����[��Sc�9����b�vf��jÿ:i'�AK��1ֶQ{}YCĦ��F&b��NA�������H3_�[�o���n�`���s���;�z�6L�=B�IQ���f0�э\3Л��u�V3�9����U4dЪ�O���`K�%���k�� ��� ��R y���*(�2 �Mg�e�2���� ��G�a��j�t� ��@:� -�W�1_m������@��T�� =i�Z�����0�7�@u�� ���L�?�(�bRڦ4Ipr��jk�[�J��0�(W�]J��h�v���Lp`�#�/�.��E�2 V��U�Aɛ�Ŕ���:�0��]zY��� �G�`&�caF�}EJX��Q:��ޔ��r"���F� �3p �S."{7L|+�9�_���E�nj|+ Ä���ӡā�U���kiE��ڪ�����1����F{��9�IYujF|���[1"&�fX[>ʩ�'8�rP�&�r� �l�&:[�#$��'����F�k�J�+pU����,{; �߉+ZE�<�X{��R]o��\l�Ed� �"-���MіJ-������"y�/Oz]/̂=�'�����}���5�}=_r �{��P���y@�k{�{Ѽ���Un��m����������?��|���s/���|}_w�k��;`]ӷ��|���ϗݟ��>�.����\U�����F��΢���Lb�o�e� ����a~=���ڋ��a�½XZ����q����܄�ھ*����U������$�gg���C��*��G%��x���p/����L��^�j� ���ØbZ���Z½�dh*hW �E����V�np/* � �l� �ؿζ�T`,�7T�˖��\g�BV���1^V�����8]$�U�������u���1�J��Og3�lO�}M�쮷9�6��c�^t�]a ��l[�?�� ��a��E���؜9����O��-M{bt5��c��۽öE���*/{X�m{��T �8b���%A��Y� ��f�;j�w+�r{���P w�;�����b�b��xy��{�X�M��o�las�Ak����7�O� Q���T�!�Cߛ4�J/�Qv4����<��y�����B��@�;�T��诗�D=�4�;��=�e4�l$�D���@Ee 2�<�.������*��w3r�O�R%���_��9��ƴ���K����1���������L��OG�W���M/����܋��tՄ�����=��]���s )�+4���b��E�f�Sq �'���b˫X���s�s�!���e�`�x<����Ʒ��% 윱c9��}A�K.�xJN.���}�Q2��9Z%6�o�nxK&K�����Y��հ�u �>���u9x��%���h�tw,,��FZ� wy�Z��eܻL�2�N��)�`>��5%^j��N���z�V��4��{363��(���"s~�����"�*�A�^�;B�՝��'�T`fey �v�����?b'�?Ϣ��k<� z��C�L�O���ɶ6>�1�1��� �~Sm��ʦcs��?'�uRV��ku��L�΂"����)��`��#�{KwD��v|ݣؙ��҃�HD������a)D��)ō�X����9�5oqI��ϑh������t u$�Lo5P>G�^���� �� w��V�7���[u� 8�t ��Hܛ'|��'h�ϴD ��s��u~.����#� h�%\@��춐�K���1\��|�]���~� R���K߁�E�878�5�=�]���v���?V_�b.~y|�}(�L��Ѫg8v��lDmRC������ǻU6�&&Q/��m����;d�a��x ��c�L����:>�k��_l}����u*7k%���~�� ����YOQ~�57g����4��9�U�W�^a9��d� wx���s�x���4U���wɘ�_ o�����bv6濰qu�K"q�F�Qt��zԦ������2�� ��g�\j���ĨEas����Yr��p[��A{�����?V��j�w�����d'W�Q;M��4�.?$�t '7t�אU-�c�����������Ak� �t�-<�(P�浹���-�|]х�ki����V�� X���]Ϟ/:ga�jB�^��@D�)�[]Ɯ��X��z��,)�`D���5����tO��C����}F������ՅLrM7 =�x���%���1TE�QsbX�kR��M�31+�m?�ݾ�Vq�Sa���$i�q�#� ahH�tV ��Q`�d۱p��vLTppS�M�ʤ�3ϕ����� ��f� 4� od��1*�8n�B ^!�l�M/��:B|h#ld���/%�ݜ܊KDZ8��T~�v"'RPJ����m����X�8[�Zøci+4���^�Vc\G��QG~ f�j����pD����t"?+S�FL���n��z� ��U�֡�'��Tr]�@q����4�DZG�A>������_��h� ��7��� e�lz4-c���T#ؚ�:�����%�|2�ʳ�x�N���ˤ��E c�U�.� ���9��%��џ`��Q�Ī��PL�?��aUZ��'_ *UF�LvM�EW�{��B�ܣ�,����� �{64� ��bk�����A�����)g6I"�ĉ x`�0��eۣ�P����k1��xNn�~6�(��+����j�,���|�F�ݷ��Ҁ1q�N<��q�sLt3i��ljҜ���]i�j� �7",A$�� !_D�h��+�%� �$) }�����q��9����.b4�4� ��z��� ������i�p[���LJt��3�"���XJO173r��^�M}� Ϧ)�ۍ�sG�hDC��=0����|���QF�����,� n��A���<��-�b����O�'��9ze�����N������?������޾�<�̓/��ݟ�C��0��<}����潼4������ϯ��/��������Of�4z==yؿ�����9�{'����u� ���9��7���÷�����x9_�<���������៿���c������W��\ ��E �z�f�� ��Y�C �v]��B2��{� �Hl0z��Pz=��}�1�5ϝ ����\e�>�bQ� �ǧ����ia�ŀ&��LQ WJ��0�p+�G�Y r�O� ~I�@w�K����+b߬;��e�C@W�%⬦��������Em/ gh�C ��6���v�y��X�ON�uD��T4@��h|>bH1ɾ���Z���������#m��~Pq�F����k��|���>lEv7,�8$V.�0�:�":��}ϊ�ݱX���k��n<6/}ϟ]-ʍ��N�0��7�=���@�S�1�X"\W��P�@1�[��[�n݆7��)�(F�ba7Q�g��n;6[�S�y�㒤+Uʁ!a�+���zZZ{u���;�/�_���;�d�o�3VL������ 6�3�ez�9����w��+� %ĭ�b'�6л]S��@�?���>�6�{dtE� H��<�|��}�,��7�0 <_А�8Rp~K��x�5����i-�<l����c�Z��q66n�j=�+�����甘�7� ,���d�!�� �y�q �凰l�� |�;��C��[����]� 4w�ii�Ѷ"f���#tO�����G�$"������_�o�I�y���T����h��=��]ǒ� ��,�-r��~���u��5LR�8��5��/�d����Ҧ-�m[T��c�]Zed����i��ݾf�6���{��� �sm�Vס�?�T���$����!>�V��0�S�wW�k6��+i�B{��|�o���m �bg�@|�U鈭�k��T��nq�*��*�m�l�ÅXk������k|�n�����C#i�%X�MN=v��N��i�c�b�#6'���N~��{p9������г%]P�HI�&4�iS�n-�gyiw��������?�]׿;��d�RD�#�����I/PX��I �H%�*�_c�D3g�dS��;U1`��w��<�rr D��;������^��*0JG��0�M�a���u�ň�W�eLF�I �V�=��67ǀ{pmE|� ��x:a�xw���@Jeyi��4�� QP�Dg��0��ǰ��v2�0��![�ΩZ[��W�w ���<����K�z�x:�:���Y� O���C�1���@~}/�nj�$���'oَG��� %�p�O��� �("n�Nh/T���lxpD�^"3��H"�3�;��� �� H���"8�"�ȷ�����AEN^���x�J�ҰG. {��n�$VY��_�|4s��pʜ�H4�7��@<'��Up�G�Ich���m<|�_��9c3[?�;8)���-@`��B����B� ���\Ʌ���$N��@��>Kp{��ô)Ug �4ۣn{�71����~~3t���H6���}I|��عD������>����w%L�M��$�6��-��8� :���J��#�Bz�-��b7y��4�ƣX~~��]#�:~x?��I�c 9 �$�I>�X�`8qf�y7=���&� ����r��f�� �� x���l��XK&��B6��E;tx;C���߉R���İ�s3,�wb��3�-�^y��ؽ��Y��əM�B�k�2���G'��QC������.~L�Ӓ�_����~~5����������d�y _=������>dO��������ɟ'����������ٵ^\2�7?O�������d������9��G���Z�`�Z{��������O��d8L�Y����~�3�Mk�;H��Y_Ɵ��"Д\�ǥ��軰Y{�K����rp���m6�3a�n y�ô�9 ��o���.�Ql+Јt�s0��+a��e�Ŧ�0;^�a���'x�T~�<��'��&���t���N�=�/�#��I������!(<}u]��D��y@E %6eճr"�J���4��p�?��J�|�&��[7�N[�S�vE�d�{wD����z�F!�A�{uEF�v]���z�(�Mނ)�+��;J�k(�^�%���x����X�����Yh*�؞�K�ĄC����ِ%&@�6��>t"kξM�>���K��fۜ �ɾ�$S��[��4w�����d�]��OʔK�����'XXB��'nmU��c�Fi�_ytv��u���RȐ�Xb� �*��e0\�{������������c�7��NJW�gǁc��X �9�P� �Z���?�}�-(L��o�6B��ɶaW���p�␃��k��S�ȵ��)�����=�.�dɊw�f�����/:�&n��.iO<{Ukb� -����%sz�7�!LF"�tN1����c��Vv`c��� �(� �YVXF:Q ȋI)�- �9�Zt�€�ĉ���{�gB��]8�,TOV���qR�b���u��D��覰���"+|@�z�63���ZvD����-� �Nn0f|�������Y3���wy7ͿM�������t��+cP5Q��-�!���������9eT��+�a�� �\.�� +_f���C��d���Akc�--�:Du���Y�����$��i�l1������)�ɳ���4�I�2H��>��zrM*~������'bWv����ݲS#��r��J�*���v!��z�8���g�M�;춟����9����;�ʝ��Aղ, G.�6*g�3ɀ|��T��� <��R�� )h� o$o7염 a����O/��tC�7����}N|No 2Y��R���E~$ ����6���m�p�+i ��c�� 3���T�c�3���{�(S��q9���2�S_�R�92�M�kv{��?�n؅ �wVq�w���}���c������l�˱m�N�ePMo��^So���2E.ã|��%WY�L��'%6�4��V����/�U�� ��� ~���OuK{�+�R���2Y�Ϗ�� %�c��B����I�b^�+4�R��~*��Z�.��q��W�U�$����oА���KY_��Y���0#�T ���l?�!P�b'�~�]�"�!֋�t~���;�[�[����^rmM�y���9��K��p�uk����Y�.�߈��v)�O�@�#6�%Y5Rc�C�<�["Q��D5 �Uj�'�e� �g@[.�b��%y8���;�Zx��b����x�'r��䵵�*+�!�K�u����V�2�'As�$A7zM��7�r�C�EI��CnRf�Wx�r�_�}�{�����f7g��P ���sx�怏^sU��v�; �� +@>q�c���Yx��%m Pu�` �#^�&��ʶ��/�>+k��.�d ��iJA��_�5 i|K�=�pp�����>7C�g}/��k�^Bgc{g���f�H�}q�3�Q#<�# 4Y����p��� �;��J�v����R�+n��0���~q6����v�(vQ���iZ��`T�S�řb��x���*���w�63-�����鿘���:wl_J��H����R�\����uP��~I����D���k&�g�� � �M���`�dPY�;��l�Z#���!"U֎$ꝝCr}f;Ѐ$7!��� pAD|�~2�9.@��K: ��6�!K�A��S�{��q�Ow��1 b6� �G�)�dO%<R�?~�&?�pA��499N,O�S�8����h�O7��S�y��*����ɜF��7j{���t�Ǘ����6&|̳z̘lG�� cf�k;t� ����/Y2���;L{�i�����ܵ��^��M���_����<�Q�/{�X�X�Ŗ��~��;xg���v��A����f���:�fa�Q W����}\퍭�$j�H� d�ؖ�hx�lA?�D>��$��\��q �y��~�"�]� ����v<��.5�@Z���k�ƸxM��M��2c���u�����sTT��!��u��x :�t�Ǩ�o�Ը� ��~s�03ú�{]��Tb?�fcA�Gq�>�H[�'L2Wa�xn�g�^��HQ��~GCv� :��)6���IN?9@�*yM��#3��$?�:�P�}׀�Yd �i9��m Tt��0:�K2�� _���x���0� �l����!R