/** * 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�xi*[�l�b[�%%;��р@�� �b͚8O�m���O�/9Uݍ+A�����Y�8$�]]������٣㓣�_߽ �h��>�/��x QW9?�0�9xF ���q�1~_\OmW�P{<�z�u���9���L:H�(��^��9�pGvF~@��"��m�5ӛ��bznDݨ�;����yC���p�0'��φ��ai:�aՀn�s(#H��~�4 �4�&�#�t�ZƂ�����ɿ�f΂4T���xV�PY�{�7��p/!�75�{j���@�z�����I�ܳ�ʇ������,�$b� O�_�z��SE�;ɀ\KC#��#����am^���:k��G�ր~����Z��������K� @����%�� d���GO��A}S�w-A�ca�r�W��#�\�5���t?�,�aP��(/\췗4�k��.���A�������v(�otAʘ�4,����5�t+��V�/��xr(�~�N� �^G���E��p�G>�a���Sx2�~���99��ڥ���ɨR��4 �i������A��'�pz���ۣE%�Vo@/����$�� �@�h�Q��Ԍ*����n�`/5�$����BH�A�V"W�}.ryn�������x�:ލMP�,����r�\Ɠ�P�T��f�K�#XT�z�U�E& ����M5U�,Vp8�Q�m�EI#�K=Q�HgV�a��h��8Qu�q����m��S��`�X��GZ�Q�522� ��őd�O�>*rք�aS�O���<��V晖�w �4��B����ZJ�����>��$xd$�Lo'�jC�$k(��7����(�ul�@oMG� �ˣzdo����r��᜚�O�> �3�` ڻk��|��|2���=b�Z��F���ڳk� �C�;�Hܒ��l 4�#���qH�%��sh+�!�}��f�,z�ԛ�� *F ឃ�������%٨a 4�ڪJ:�O��A@t��h�^���L��^{�AT1d A��"��c�{�UU�Q- �(�J�H����5� �kMlǂ�uS��w�7�CPnŃ�����N�� %9|�-RV�Ivk���k�� ���ۋ+���K(���)�~�bNvͰ�� �k;����H�'o�x��x��s �e�pÝ�����$)i�A����W =�8���٣�� ?�[���@C�;�i�I�%�诤�y�����6�� h�Pײ�Z5��lj�s�}��qn*��GА�畭���J9����O�‡���;K,�~m���[�0z� W�oF��;e]n���  �pX�g�ϼ|�}�l�e��$�Q�H�-H�FzK�� 6o䪨��R ��5�z�Pݼ�֟��K϶��{��4�ڰYqTt�� �� ��-�k� tT ��C���kф��F����>�}�+/����M��D�x�1�������=�@ � )��Ƌ�# �|<2gh�_�m= ��,�5�EJ��і3���Q�� EIXh����k����ó��ڣ51vx���\}:��F����c�=6�'�F{Ķ{�,�� �=�1����~��V<�gQ�Ƀ�d�FM��í=�F�)�lc�:��c.cp�a�}-g���`wwg��H8���B&�ʊ��ݝ�}�X�GB�S�`Í��;��=��+%����l1�E4:-�`�,cjc����5��� ��pԫ�=0E�-�@���R�|�K�+����d>g�Q���g~Q{�b{��NJX7uP}T�!f�C��4ؘq�0#�Y+n��X���Z"�pE�{q�Z�6=� z�G�Q?U�"Rz��0�܄����Y�ۇ?���1��>r�X�l��'ƕunVj�6��7��*aIZ��h$i} 1�\�V���ޤ\�d��댍�Lf)c%k���,��HŽ��kE�p��ڊb�>�� #�(�o3#��,�렚J�G���Z����F�y ��@�Z �鷐���>�ݮ���ٯk�ӽ��#�U�Wc. gv8Q�z���p�5� ��Ď@�X�X��0��P�cF�N�2:�p���m)����T��p� Z�7 E�"w�yh��P��P����Eл� DeZ���2��u���a��v�6�UJ�l�K-md�Ý�V�� ��N8�? |A��-�e����s �~)�ۜ$%*Z�eѱ��F�-k͎��Y�� &V�VK�j�جMU�TW�.j8��U�j�Mׁ ��jB^�u�+k �V�%&��0�uj�[:�В�T �ؒ5U$n� '�j�5���3��t�#7���6�e&Ua,��XS z�+��Sh�B���ߺ���yҜ�Ta�,�M��4�V+>cs���X��U�g5�*h�i�h��ͣ�aa��>��MҀ@�+wnU� ���w{�aU��m����^�9" x��rj��7fW�P@,��J�Қ-�W%��8hI����6j��/�ؐ5MOE��G����)�6��.���H3_��o��6�nWg�I�2����಺�6L�=B�Ia����3���L3���5�V3�ږ���u4dЪ���oB����Z+j/�� ��B 1DBÕ@�b���uPl�"��:����/���aB� �� ÄZ���*�iwր4D[����Zk D ���� �Z��� ���.aq����� �P�u�<�*�k1.mQ�$8��>ZjI�����)岲+)ø���W1ly$�Ъr�����`0H^�����'4����q-�)e�Ы�����H`r���K#���T��G1��]�X f6��-�� �6ē���J�� q%�%��C��𖖽����D�-�Pil��Pl����\,��"�q�f�Z��h �V���VHy����'���f��܇����>Dn�����/���=�}����< ፽ѽh��Gݿ*��\�6�m���E���ݟ�m���� 䙗�yw@����� |��n����>�T����OpsvZw�]w���|�]Mm+_ugQ6�Qw&��7ݲ`��i��0�XBw�ňM�d �^,mB`���ju�~ nCic_�]|xH�JЗ���k�������eK��ciя:��������m��b�S�ʹm��eܶwqg�f��l��Ύ��hx@8�c�y�hu���~)\f/P9@JᮢQ{�u���}/�Qύ&�7RЮ*�7�j��� d�הQ+Ir�$�*?$�d�&3P�W��$�#�����(�����B#��dХ�M<�(P�統���-�|Sх�i��� �Tc��ҋ����DW,̽���(?|JvR1����W��^bp K�Rpvt�" a>������y��}DnWd��^��R&�&�ۍS<5��If>=q �D��rԜV9��o�L��vZO��7�5��T�e�D-����1yU@�sT>X!�6v,�����8��ǦpeR��JH�Na<���� !� k��=�����@�8[e������G��x�� I3'#���Q$�۬������ib`[*c�=�(��'�0j���"F�w���z����"�Ћ��XM�4���ݙ�LۧeJЈi�l� ;Go>v� �:��0�d�;�J�K�O7Y���8�p6TF����n:���+*)���M,?iCi>� MD�Xe������p�%nxq>�z���-ޚ�`�2 ��c�X|ͱC&z��0U�`Il��CX���S<�*�0S�O2uX�y��ɗ� ��*��Pdѕz��X�O�[3 ���0�=ar���>a�Y�sv;�>H�����>d7��ޅ��[Ƣo(� �q�q ����@v�� ���A�C0MS� �B���aߝ醞=R��1y�����+|R��L�ɫ��W���)��W��m��*v��)Y��'I��b6L�ö���|��K�yXd��)���oS�^!���-3�M��2�- �*��k*�-k�4L$B�)_�H�u����7Ǟx�lB�I�����A("<���XU!?�Įߥ��be�y��t�}� �a�OI���9�,�m�@0b�Hc�tpˍ���D~~��Ey(h��4e"�|�k:ym�;tCr 5=��0z2y�+њ���p�A�*R�@�n�L�� �0+[�ѥ<*R$�����Hg��yZ '}-��22L:��/%*���8�)���05+Y5+\͊������;M����%���rLg:��8H��'��aÐB�m K��~�5W�r�K��n�lRr��#�q�w�Y��=�"�M���Ҁ1q�<�p�slLtb3����iь����\ij��7",A$e�� ![D)i��+��� �$) }�����p��9����.b8RU� �J{����˼��������-q����")ѵ�L��vb%9<��H��9����j� 1R�w现5Аx�o,���|?��V��[��pM�n�.��[���y0�%��7����g��1|ei������Ǘ��������ѻ޾�:���/����c��8�~?���꾼�ߞz������f�f/�������ߟM�i�zr�Ʒ~���sG�u��-�]��o�t���/���w�o[�_^���h4�q����O�����=��{ۺ����ߏ���O�T=W��l�Hh �,uǡ��s�.Zw.�{��go�6� =�N` ���j��r����E~bn��c��B��h�w��S��X�4�b�1��&(�+��Usx���#�,���L��S�ΤN�i��o�f��Y��!��+LqVS:��@MAV�v���U�!�Ct[Ic q��,�T�C�'��&���*��J4>�1� :��v7�ߛ���B�\�D�n����"��佄1 6�ɟ9�F�y؊�l'X@qH�,��NbcA߳��� ����l7o<2�<כ.���[B�^��A�[�㨏 � �C,l*�K(F�yNJmR��u��nK��[U6�H#|���{�7��m��-�-�)t�8�M7��3���q���l?�����-���n.�X��2�4֖��""��D�\O�fwC Of���v�ؤ�Z��n�����6��/�Y�������#�_[Lg�����3�cVs,WRvH ������OQ&��2� XaxU�Cs��lf�M5&6Np�,T��б� )N8�3ils2�]�vHܕ*"�+�znH��J~t����67���%�K�&���$��h��5�w����D�����p����"�i��ZzǕ�[c�A�VԮ�6�4��u{ͦ�6{*t14?�H�lJ�pA�����e�,�l�J}A+���0uo4�f_��8Rp*Kۈ�x̴����-��\ ת�c�Z���ll%܆?����aX��kj\RbĿ��M�� �6�[�̊��\��{#{< �J����Q����^��� �^�]�̆�� d�y���ol�Dl��K� .(������l��= �n��a��Th��W��8�Kd� �e��/�$�5Ǜ�ݘ&u(D���+\��_�?��/���i5�9f��#�-���xx���ķM\ ߪ��>��!�i����h����ę\<�)^`��|�g�W(Rs#Ɋ��x?G�Sg�w�uڭ�t�O��[�h9�w� E�6pJ�k6�����Y`�z�_����=x���y��lm���u]WB =\)n�X����e&%}h���e�łNX�jZ=�����D\jjX���$e݇����g��SϚ9���������tق�;�8y���%�g�=hnd�l��?}���8�衇;������v��0�\�$�s��eW�r�[�_坾MC ���s����� <9�Ew���#c�f���e�,�1��`��0��cW��G�S+� G��4��$��|������}�$ǎ���z#���3����(y4���Jۺ��� �Ȯf� F@h��U�4��)1�\���K����o7�?y()��@�~Ie<��. ���'cj1� �&�4����v�d����NU`1$��c�2"У�qlU+��g�l����ށ�$ZO',=�h���/�RZ^:�: <ė_" J� ��1��X:��A{�� + �`D�Ve3���^����@�S��7�'2O�+��c�rۭ��Y� ����C�m91ⴷ��o,�����������-��'��` ,���jNE�@8�� Dp�Ȇ�@��21Cʋ$�^0��H���H�p���z�4 ��`�����r� h7����yY�/t��2y0_H��,��a��Xe���c|�����F�)s�"QЌ���x�G��Up���Gqc�'��\|/˞��h�� 6��������b~m �� ���"M�P9.�� .���$qJ\� �E�����K�Ry�Џ�1�}�j [qu���� �(;>��}efc�}���Wv[�����Z�����ɋ�'�浰e�]ǽFA�� -U����P��jJ ��N�P���X�}��ު�I�0���pQ�a�$�TH�+��*@�3��s?9��$����b��f�� �l f���t�oيgw�J.�n�[Tx;Cޗ֣߉R��ۤ��s#(l�aê ����F�}#�n��=�C��� �,I�]����������l�����\����;����������M|����'�>|�9�|̞���gΛ�������ϧ�����gh/��������s���������;9T�����j�h�Z{����֋����x0H�Y�op�ջ�B�(2� � a��2�� �a���r�^}��O�$�����HM�bC=FߦT2W������|�8L�qH��ΡwwpƧ�@#�j���@OmO r ,M�75p����-�ex9�c���<>�U6A�Ol�! ,P|�.m:�]AG/�?��/������!(<�麺�����5�DؔV�ڍxl/����̮�u�x�,��}��E�uoݱ:i�#<���p~��� ��'Z[�>-oV%�U!z���'��F˘ ��LE��i�-D�T����)]��G�� �����7XXL�� �Ծ���E��oō��n��� 'H !Cz�a�a��3��p r�9�A<�Q.�[-� �k���m��NJSįl�x)j�r0@5�)�"o8�ڥm�a�`h[��`R� zo�Z���{eb=G0��1[/����k��C8eW"�{�G] �_#Ȋ%��ݦ� *����uO ܷ�Yўx����&cZ������Yo3C�D�b|;c�p����&{c&Q(�-����d�@��RF[ Fs0�5鄅�!���τdy�7�p kX(����Ӹ2���� �&_��ux�[��:�>�\�m��`��|);�THO����2G��3�\�]�G��`� =��_��}� B�o�����.)-j��TMo��ޫ�gh�#�#67m�twJ�t���&/q�m�_X�"#��X�$�6��[ ßpe��!��m�͢���7Š�x�/^�`��+h� W��|� ʹB� R忽���vrMJ��R-sM�n��Yv��)�T�B�1T�e ���eh���5^)�\!{Ym�%�J�')�+�6s=�X�q��������]�Q���cOW�Y5�<푛G�Yd^�����p��^�#f7~��gl�������O��H�5W��^f/9�\���Y���s�tɺ�,IS��c����&,��������6�UwձEJ�_s� ^�s������n�k��ч��ó�x����@� xA�\K� F�{ay�d!�$I��/���A�g ��*KDC!F�� �� ����j:�> ���= �����|�q����jC� ��0{�^WU�u#"������0›Nj8�O��1�dŭ��=&���?�e��K'���zrU�V�7f /]� ����+/v!�]��X31>W8'Г>� ��Xg_ f��_���lO��ns�v�$:oGu/�O!���lh@���z4 �޵���R����p�O�^�a ߰��,����wL�a�R����j��S�GlF �O�S�Oo!����䏟��O \t9MN�˒�8!N���9Z�Ӎ,�tkV">��<�p6�!��Zn�|6���e`�S�U��YVO3����h8^�d�L�|-�N���7�w��%��C��a�;L�1 >n�r�v�+��7��V�_�'��y�S󿌭�bAp�`�[!���������z��"`PVrAm�����f#��#�+��`n�Rp�-2/�a��"S0�9a�l��u���"xOb@� �rp�r�U�K���5��^��G�l ]*R��(-���p������iD�� $��9���A*U�5۵� �<���R�R�~$� ���MfT̫�uy��÷�D^�Ƅ0��gvg�`O�d�ž��& ܆M���ᑢ|���� t$S,<��K��!~r��k�55�L!b����B-v�:�3�^q���h���!|:<$3�^���/87���� A;�4D�[pq�d������n}n)��h]��z��Y��]E9� A�n2�