/** * 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�xe*[�l�b[�%%;���@�� J������y����?�|�Tu7�)RRr��%����uuu��������Sw��!����� Өi��gQD�W ���ؗ��I&<��$����6�F/A��� X�45M ���f�Z2��B�vl/BFF4�&;��v�`�Ա�'��bf%%Ӆ��̘J$��b3\�2c��a}w5u! U2��� �K4�.g�p2 � y���=�R[Z߂Fސ� ����/ڔCK�� Y��P�, nh��k �(#�L១+ �R\��|�s���� B�1���� 3��oɳG�N>�oۗ�g����e@��g��@a����fD�BW� F?6>6"�R����k��G��~l��z[����F׸��,P^ �1�D�Ⴢ �}����P�T�_K��nX�������,wf#��K`�. � ��� �������9�89.%���2� ���h4�,��#{�� 3$��t/I'V�֯�p����u4 �?��(��T��)<�Ӡ_��%9�u��tg�xT���E4��I쇠6<�� |͗:9~�F���h^���Ћ5Ar77)��4�5�Z j��ZqM�5�M�E�=B�ʻ�:$���)Tk-p���@.��7��04�5���'�S��\�j`]�{��1��⦾�xz$V)����+��~-2�`0?ğnꙂg���K��X�4rͱ���qf�����g#��>� M��w���i)ذV����TDk���sS*gq$9��ӧ�ʜ������o���=��v�V�wK��R�9�R����^H�����=V�I�:�Ij#��I�?ԇRE�Pd�o=��QR��(N��z�G������_h�����{b�}�4��B/h�U �=���h^�R�j �b�z�Q!� �b�V��%Ku��h��|A� [��/������eH���;�?�n�?��*�=%A��݇H��b84�:�F�DR�A]@t��h�~�B�\��_��A\3e A��b��c�{�U��b5 �(T%�~�Ɏ�� a��É��аn���.��Nʭ��/�� ���$G��E��*>ɞ*\q4�fm>�@P������h����:�2�'(Tਦm���^;Q�=DM::~sȣ���Ϡ�k�(�����\_� Mɺ:`^?�@��3���|�3�I��3�Ui�� 4$y�鐆�45�~@�ϳ�w���4@��Z�wj��V��)�������!!�K[��+5�j�����>�_����,� �9��z�n)�� (4\����º�Z�; >�z�.�r0r�{��~��e��$�Q�H�-H�F� �� 6o䪨U�R ��5����Pݼ$֟�� ߱���ޔ�4�۰U�Tt�� B�� ��-�k� tT��@����xB�B�_Qcm|����A:��+�լ� *S�>-��ys~F��[U"k������޽�=�A � )�����#�B|<4]whZ_�m=��,�5�E*���V3���JD�^k%a��?� n^�����e��>U����Sp �ⱆp� -%���e���yȶo�����%C�:F��ӧ} �a��??��a��hBi�C{���bɚ���W@S�XQ� �7��aţF%�GP%4U}��vXe���v�����"��t������������-�s�"��0��WV�\oom�N��O8�șb�^��C?�i�'0�\̺R�� ��s[D��R ��2�f8v�>ш�j݅lPT�#_�t�1�)����o��+� �/Ůh2n�ө�FJ���Eq�ah���M"+b�4@�q��P��`c�M��r�'��Ѯc!k F�T��,�}���tm����F��L�Hm�n���&����̢�.�W{9��Z�Cn����M��Ĥ��έ���I|G |�����f3M���O��n���&�%;?�_�l$a2'H+y��4=f��Z*_+ 0�s�0�V3 ��UE����!�f�� ��4���h�j*�>i6Z�d�2��q 9���ߝ��J�]�݆�)�1�+PQP-}�Xc?�0���p�De��zl�=�̠��81��k�&0]�`����f��¹pl%��W[#��ΝA��g�(V�9��eb�ʘJck��zW���L+��ְ���8 P�^�F�JI��������U���Zg�I�� �fa�"�Ӳ�ct�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���8F�iU�s$��VT�����_f�]PHK�w۷��|�E��f8U�; gӕ�-��Š�ٜ.�V�n�y `ŀ ZI0�jq��$iX�� ���4 ����[�j-q���dXUZ$��7p��j�������-�@K�3���V���vB���cm�gї5Dlʺnd"��S�w��r�D[�m����-z�7`t[�vF�g0�d�9�X�pY�[&u�!ԃ�(ZM]3���F��MVٺq�M����*2h��M���`K�%���k�L!��� ��R y���*(� �Mg�U�2���� ��G�a��j�t� ��@:� -�W�1_m������@��T�� =i�Z�����0�7�@u��ypM&��(�bRڦ4Ipr��jk�[�J��0�(W�]J��h�v���Lp`�#�/�.��E�2 V��U�Aɛ�儆��:��RF.��_����#U0�б�0Cߞ���t��o{7�l��\������܂픆 ��>����v.����{��1�� �0a9�D�t(q�l�E�z2�ZZQ$���"8�����sL�i��ިl�hRV�����V��Ʌ֖�r�����Ԭ��\�3����V�HIk�I�+p�Q㚸R� \ա�zx+��N�G�w"��VQ(�4��^*�T�c.[fٸl�H -�wS��RK��x#��HF��˓^� �`� �Cdm�p"�{��`_ϗ܇���>���w�����^4���_��x�{��&��������O�6������˃��; _����>�X��mw�|�v*��e�'��� ����;W�F>뮦�����(���;�X�nY0��2w�_����b�:vX��p/��!�n{\��p?7�����/><${�l��5��������Ъ��{�Q��2(/2܋�"��4������Ze����0憘��y��p/2� �U�{�)�����܋J��?[7�&���- �� U��%�; ��l����wug�WU8���&N �)��|� Y�t����m%M���x��'ݾ�v���f��ı|/�ﮰ�]��-g��DdQ���"b�~dNw>xm����AKӞ�]M{�Xk���m���DS��K���q��ŭ-�H3��nŭ-EI���p��:}���[�{�p��@�i(���F�Qw��c l�yS�i���Z��H��r,�����_��9�5�bl��mB!/$Ua����� ��Ka�M�*`&O|w��*��D�{5�i��,,��%5QO$����d�m��%I/Qpa$PQ���5 #� |��s��t��5��L�ܦ�D�c�T���+������"|=μx�O��QMh{.��@� ��U�[:���A��-Vh[Th�?�Pyۏ(�����,=�O1���X�]� �����È9�i|K^\ ���9��I��\r��rz �����G�ȷfh�؜�m0��-�,�^�n�f�/W���џ��’���)b���ãQT�uܱ�`�i%+��j�S�q�2���;�*��ׂ�.֔x�m�;1�Z��Z%��� �������B������Z��� ���[x��w���;o�O.4���:��z�~$�����Np�Eo�W x�*�`�(�Ÿtku�m?l|�cc>iz���Rw@(��̙g�`���IYI���u�0�; ��VP�D��]&���-�e�3��!t�bg�{��F"�[�������b�7>b��V��L׼�% �?G��' wW@��%ԑ�3��@�I��L>O�/�Ѹ���J� �?��UG��c(@��*�ĽY§}���LK�@�t�7����6�pq��� (��]�p #:~=Fc�C��ϑ��@�ܵ�/T�C�U�`�;л F��F��l�述������7�؅�^ޟm@J�����{@����1R��P��2���)B�A �`̷������q��%�� d�U.�Gk�/��n�� ֗��o^�"���o%*������E�s3IVy'~'Mcd^ ^~������N��pK�F�0wM���IS5�j{��(n��0�������X-���C`� MG{$'ha�E�A��@m�� �=��+��p�z�Х�L��\�Uv��>(�%7h�07cy�;�q���x��#m��}ת�=?�Avry��$�OS��C"K'nrV~�X�R>B�����4��4�6J_���s��j^�� �P�2��]Ⱦ�:-mm�����O��p����K�&D>�% ����e��]���h�\������]�HJ�O��|<4~~pQ�]Y�۸g\]�$�dq��c��'�=��WOC%Qt�5'�U�z%�ۄ:s������mg6y���f�;���DLb�PUAH�� ��+�D7��T�L�!<�B�(�)� �@54�e��vC3e��P��Q���dklR1?3��Ca� �=ƙl��S�u�I�����͆���?_og�}M<���2�����6��I�@��e�SQ�`kJ�W]�����)X�*����9! V.�bL>�����db$�JS� �t��|T �%X,A%ө�C15�$W�Ui��˚|Y�T�2�5E]����4�=bY�OS���kh�v���*g���xy��ak?�C��Yj�]���Ua,��2 G�� �)��d���[�T9˲�0`.tT��ݹn��#E!���?i��'E��%�:=xu���o�چ���b�q��ҵ�d��D`A���?̆ �rl��I:���v6Y�gE��e�۔�WH*#{� g�a�L��J���Jr��8M�Y�'V Cù!<{��α'ީ'�Ȃq���$~��w�H��l�"QU�,�yiy�X�l��>�w?�B�S���A�"��A���b�\�&��r ��� �_P&oS :88͘�'��A^�����@�AOE�I=�����nGc� sQ�_ \�J. D�Ѕ�K�U��R���H�J�~X�3��<���?�"G���� �_^^�I6S4[ajV�jV��C׺F���v[zwWkHxG�Ř�>�v8�q*�!%NL�Æ!�.�� @���k���ܗ�9����,�䊯K���瘟�h>�le$�o��c�8�x1����:��&f�u�ӣ9+�x��*��9�oDX�H��WB��R�2!W�K��IR2@�f{����s~��7�]�p�iA|��0l�%�{��LMc�~���/���2)ѵW̰�vb)9<�����qzI7��6<�b���4*�ak� �b����������� ���Y�90�T/��{3�yp�[��h�㷟NN��s���߿��kϏ.��W�_���w?�}{uԛ_�߻?�G��Q�={����潼2ޞ�����ϯf�f/�������?�N�h�zr�&������9�{����u� ����x��7��䇣���/���r4��y�����/�������ѱ/��0����՛��S�U�U�l2_!Z�K@�q(a�ܮ��]H�^p��� �B��Ho��Z�/:�ܷ�3f�������'�P,*�������4:-��p�$�) �Ji��ne��6 D��)����T�s��E�u���l�c�� �D�Ք�2PS�����E� �xH��FҘC܄8�����Y��h�ރ��6�O�C )����ߞ�������V�u����*.��H� ��p�����U�݇���f����ʥF'PD'����Yq�1��Q| �[�����������x[���9�q#��QD<�c�%�u� �#�X�uj�����m(qq�ʚ��b�/�v��z������a��:�������z 5�>)�����������}��A��e�ːCVf����RDD����#�s���)��,$?8�.���as�A��m�0q~��$X8�%� �z�y�||$U�k�� ]�����aFv�a͊�c��J��!^_��r<��)���^2T��A + �Lvia��,����� �F�EJ0�N4!� Gv6�M`Nfӡg:.I�R���R��=��O�x=�sA�����A��3If�&z1c� �_&��P�A#�`S=SZ&5-P�A[�rq� �"�@B܊�V�ީ��[�~��h���<��{هѦt� ��\�_|��˧���w��y��#��G#h� ��#'�$��h��\ �*����ɳ� m�=V�%�pgc#�6�d�c��aK���yA��|���tM�r�������|�� �M��"?���<� ��:�z��v �rg��l+bf =�&O�L�;{�GO"b޿ �������Qbn~r�F�(Uk[5t�h��=��=ǒ�\���`�-g���~���_��4D�8����j{2Y��MSѭ���ґBGCiQ�� GK1{�@��쬿-kM��� ���mr]uVם�#�T�Z�$���!:�P��0���w��k6ݶ��e�B{���\M]/��]��M����݆f4 C%�C�s�x�c �~𢶕� ���r���E ]�9����A���4��q]����u����Էg.m��l� ��([q!���|�;|�~l���;#?����y{� �*��Ňf*�p���!�eVE�$�(O˯�:芾��/�`T�m�3��V��tB���Z�����q2���+�\��x඿�:t`I7�y��Q�� t�����; �Y^�e��D�C�\<:%ƽ�|��/��/�������+�N�f�� ��8���#"��YkL�hᔘl�~��2 `�7��m�<("r D��6�����`��3�ă���A����q�d������[`1"�5@�!%A�� ~h��}.� \[Y��8�NXzN��^�/�RY^��6 �ğ�B�6��"`7��!���({�� + �`D�֗s��Į����]@���� O0���W.���d u�m�@� ]%�= b$io���"8^0��I8��O޲͋a_:H`��W��� �("�Nh*T��lx�D�^"3��H"�3�;��� �� H���z~�"�ȷ������BN^���йJ�ҰG. {��n�$VY��_�l8u��pʜ�H4�7�@<'�~�*8z���ä14Ry��4���b 휳I��v����u إ�����.�i���q�6Wr�D��<%�S�*G���~�0mJՙB?��۽aSO�c ����T�əj�+s[�� ���s�`牥�?}��w�2ߕ0y> Γ�ۼ�����W(��st�g*9�/� MC������g��F���|��]#�:~�� ��I�b 9 �$�I��X�`8u��y/=R��%�B�Mo��f� g� n�9�lF�o>K�Ě4�o+�mx;C�V�߉R'����s3,m]bc�s���^y˒؈��Y�cə� �B�k�2��j��s�� �U�aj�x���i�ίϏ�_j?������l��l|p𼅯����^t>�'��ɩ�������)�������_�lv�W ����ݳ������������9>Ў���Z�p�Z{��������O��x0H�Y޹���.!f�քw�n���?%'?�)�`�K���wac��d�${���6����l�g�`����as3����K��]�n�V����`,�S�W�B˒�M �avRf�f]�����y�O ���3��Y  4� �-{�_AG/�I������!(<�麺�����5�DؔU��-�lW��N����U�x�*����E�wo�{;i��H�;q~a��1��'zG�=�-n�;o!z�� �`/y &��IW�(ͮ�t{��(��������K`��қ��5��T��=�F���J��?p� KL�lܶ}�D֌}�<}�3t}����ms*�'[<�L]7o!��̝�� ��,�3��[��)�H���O��� �6�ڪب�"��>����\�mKj��0��!;���0�Uƙ�`�9������),�Vm�3�ݒ�o�%������x�k��6@�� �"o8��Ez�aw���&aR }3��<�MM���J�8\)�G䈃��k��P�ȵ�>(�����=�.�d��u�����l�/��&���.iO<{Ukb� -����%sz�7�!LF"�tN1����c�Vv�b�]� �(� �YVXF:Q ȋI)�- �9�Zt�€�ĉ�?�{�gB��Y8�,TOV���IR쎁�J�u��D��覰���"+|@�z63��IYvڪ���-. � n0f|�����`άz�+��v�x7ȼڿ�wq�W��*��U%���7D�i �ሏ͍@��gSF%���{���������eFXy?�yIv�>��6�?���CT�;�E��I���,��1�k�R��ҥ:;��A3��d*�����s��'פ�')(��;u"v��z��tN�595r��j?Wx�T�B�?h���~�'��XZ~��4�î��Y ���{?����ܹ>�9-��p�;`�rvԒ��LNU�����Ӥ)��ʏ�֙�F�v�~���:�Z��"�O7��wS�*\������ �5�,e�Z�GR�Z�[j�پ '�K}a�W�����X��~���`L�+�e��jӫ��M�Z��͡1j�]��v��C��}Py�G|�˻�G�<��1��� ��ٖ1��Z���9�5���9+S�2<��H�Zr�|RbOs�h�����X�0 �ˮ����I�������T$�/�)�����حP�B��� �O~ޛ�n���>��!����N�%�"W*+��K��v� �-�R�W�bE��,'̈O���"ۏc���IoRa�����x��8��{?󎇸}��nn���@S|�*!�tΟ�w'�~?O�F$���HT!�{QM7/Bm9�$Cu���7&� h˥U�[�$'�RpgT��c�Z�WY��/�C�����vRe���TcI��<�?� \��$hn�$�F� �S�F�3�ch��'I�v�M���,� ��AN�+�Oy�‘��<���l��/�����v������k�JqY�Nz]@#!�d�'��c,X� s��M���Q�z���\����C�ge�u� �l���F)�� ~9D �oɳG�N>��fH�����s-�+�ll���q� �I��/Np�1j�'v��&K1������v��_I}�t>}�G �Օ�bZ� ��6Ҏe�� ���=M����q��8S 4��ϓ�?����>�%wm�:�3��WL�rݕ�[� �7�5Wx�dh��_�8x�sQ�<)ƚ��ټ:�y��Ăq��?6�3�T����d4[��P�vtH�H��#�z�g'��\��4 ɍCH��bd'�X�R� �EiI��i� �״���o,3�pȬ_�� �,<E�R�^Wωנ�H�������T!9^��onffX�w����J���l,�(��g7a ��I�*�Y��­����ǻP)�7��hȎ�Ag@�0��S�5�)�'��_%��zd [��'X�j�0>�L�+��8 b���a4��.�+2��]]���X��.� �l����!N<>��wC�p����p~[� E���oj}��(�7ۊ����+���