/** * 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�_�V׻u���γ���o�E�^Bkof\��̘P����#��=Ŀ�j�o����;��y�I��T#<���U�5�m@=�n��lSF�>i���_���$udX���Yn���idN�x����c�*ϛ@��v���8LKJ���H��A���;�iD��փ0��j�@�d �`ݓ�X��]����t�S�40~�{��%����݌�.��y��_�-��(����<�,���ͺ��U�2��&���zW��R�L��\�yHJ�o�Bc��ꟍ #���ɳG���?��뻗�ky���ҧ3�}J��v'!�kid��"gS;$cۡ����'ԥp`�V�箉vZ�kn����W kt?N'f�V��`���u8����0 ���3x2f~���Kr ��ʅ���ɸR��i��� @m x��A��W���������E%�Vo@/����$�� �@֨b���{jF�����p�^��WލU!�vΠZ+���}.ry>�����PeέnÄ��q��|L��ǹ���n�"�����>����h���ynH�,�$P}��Q��&�5U�m�;�g=���<�r�NA�fB>\HїRZK)�v<@��Ϫ@8 ^I-�ۉ�G�H*��������>�kE0��Oӱ�B��h���_�� ^9��pNMϧO���CH��5KA�E{>���S�1C�@S��ڷH�¡؅U$n�R�f 4�# ��qH�%ծ/����p�e@����?Ro�5oP1�{J�� �ϗj���@j�*i�+�u�M�:�z� E3��z�}��QŨQ�H�a>wK܋���)a`@� (<�#�f+h+P�:�ڎ �L��of��܊!��"۹�r_J�p���Ț��O5W�8\�6M� ������2������e�OP̩�V �zqr���{��t|��ǻ�!V�A?��{QV 7�y-!����A��vt�����}��3L�|�=�H��3�Ui� 4$��و�4%�~@%�ϳ �7m��UU@��Z�vj��V����)��sǹ�0fACB�W�" Z�Wh(�@��_?} ����0�Yb�sh��Tݒ��P4h�"}3V"�u���7$|(��a�6������'�g��@( �$A�*G�hA�k䡿��`�F@��J�,��Z�ƑVZ��������{��4~ϝq�Y6+�DAP1��{�T!��+am^�!���J4�n�Q�����>��j�� P��i�J����O����xs~F��[V"m���������=�@ � )��Ƌ�# �|<2gd�_�m= ��,�5�EJ��і3���Q�� EIXh����Lp�m��Y�^�SE��>�p)+'��R�*X��T�ȣfy���b(Rň�|�t��5 ә�gGS{l�N)���m ��y"�S�{2(cFe3 ��v3.�xXϢ�3 �d�������k��ԌZ�1���V�1��18�0���3X�r����sIP$��XcQ#�ʊ��ݝ�}�X� GB�3�`Í�!w� ����YWr85@ݥ�bΊhtV�a�rY��&��'*Q��� ��p�+�=0YU�q��M�o)W>����\��n2y��(@�#�3�Ȏ= �`��I�cE��:�>�� ��!cll̸�q���7�M,d�����>�G�����k�s���x<流�EjCot�>7!90,{�{��_�g�ki��- w65��ʂ:7+J��&� ��JX��4�$mCL>1�)�ޢ���k�l8�_gl$f2#H+Y�H5=a��F*��]�20���0֖e#����Y��f���)7��Yo�j��>iԛ����ґ�~ 9�-���v����}ҫk�ӽ ��'�U�Sc. �v8�'z���h�5� �˩�J�Z�fKa|á�ƌp��et��.� ے ~�9֩N��9�^o�`E�����P��P����Eл� DeZ���2G�u���a��v�6�UJ�l�K-ml�Ý�V۽]Q'ڟ����QK�E'�,��\�-�_�#�6gI���hYtR &#�Үi�NM�;5�J�'�X�Z�ZW��f�h�����tQ�)��Wӯh�t`��U�jMW�5���J��$���N zKZ55U&�j�*�b��L����z�RB�ک5���6�e&Ua,��XS z�[��6��B�5�׺�����@��f2sg�|��`� ��X���j��U߫=��PA3NF�Mn�8 ��z�7I�n�s��@M�%��ۛ �*]m�� �:��[��Sc�1����bi�Vj��l��*i��AKj��ol��<�������驈�:������'��Zo#�|�g�[���d�S�]��']���n�����0����$��z��,F�3�@k����[�hf[.��Ѩ�V�^�� ^[j���$^��g�,�  Waȋ�OW�A��^�l�뀮b����� Q'?* �f3��U ��i��&���Jk D tE_������HKQ�% ,�e׀ѿ��c�C�N�WkD�S�b-ƥ-J}�'wٯ�ZR���4� ��rYٕ�a\�Vi�ˍ�<��Ҫ�0OC[E� `���;(yӿ�ҀV;�ZS�ءW��ᣑ�x� f�Vf�Y R�r����m����������}6B�!���[0���`�9 ������u2�^�yL9��2LX�,9�A8��a������ɨ��ή� ?��rZ����*�!�U�F�G.<�#bra�գ�jv��(5�++��A�c�%8�A҆x�\IԸ!��Wyh��Ҳ������H��e�#� �����֘��VYD:.��,�B+��m��J�<� )/R��������,�x����?܇��^�>�7�%�������{��$��7��;���W�6��ަ��?��h{�������y}�<�� >��7�uw@����� }�0���݁��|�� n���B�.���U��Ϻ��m��,��>��$V��[ �9��f�K�n�����!܋�Ml�W�.܏�m(m쫲��^ �2�}M�~vv;��>�l��^|�b,��� �"��n%�x���Ũ�� ..<��!�U~��%܋L���F~��^t�Jh����#)��� ҉��t H ��zC�l��y�2��u�; d�J�]��U������e�ʼ0�xC�9�;�os/b[I�il�m�I��)���6�YF8�M� �+,�s�m`���g �A�8,?��ؿ3�Y ^���q�T�'�QGU�>V��;l[4��� ��Ҷ&��eܶwqgG1҈B�[qgG�c4< �űN����������|��:����tN!%x9�f?�_�Ж��t*���$�QlyKyizf�bF���P�,�OC��3VS����@���=�M;Z��#9�Ҏ����-�����g��*�9]gv�[2Yi?����g��_�����?���ŭ��s�`-ևKð�i�ca�lUҌW�� �j�Zýˤ,SkW˘_ �#��P╶���Xj�'klL�.�7c3c�[�� �*2�wgg��/���g�~�2��m>���3�(�[���u�@7�����y�-^m�ZF � vF�d ���uH������9������JS�=�Ps'J��8鯓���_#�c�`�w�?��,L �LA�[�K?���A�F��sٵ�D,"�� � K!�k�H(n}�bݭϙnxK�Eˏ@殀0�I�#�g�x���9�2��|��_��q�ykx@{�R�P‡nbU���O ���(���oa���ml��&�/B P`?�$�Ft�z������C�eׁ��M�_���TˮV��w�w��/�:N#��FO�述������w�X��\ޟoAJ���S�[@����{1Q�TP��*���(B�A �`̷Ξ��΀��q��%�[�2�����K�_���@������DP�,@e� �sc/�р�G^`�&���'�������U�W���7��d�K7m��� 2Wm�;��4����ɘ��^ Ck ��< g�ț G��6r�I(N��83 �~�C�6�,j é YhO]c�P�F�m(�%2�M�����pȃ�\���ٍ�n4����Uq�iV��U ;���ZI��%���C"K&i2�S~wX��Q>���� � �.4�"JZ`�xFQ�^�kc;� [*��� �7�@��n��A�1��) �� �]Ot��ܕ����@���S�{��9�ϯ����KX������I� ��g���C �#r;� �`��+K��,o1zL񤤾O2s�c(%�.���İ�Y_$C}Pgb޵�z��{���,�� /3 �h��F �W�Ѐ� �*����"I��c��5|u�(������r׸�C v c�P ha��HXc<��q����@�B��*�@������F�؁u�^H�;�e��#q�f����v(��C�R���Fq>>��q�T�h1B��,�c�D0�QG^f�j:���pD�8임d�>-S�FL�e�n��y����֡�1%��Tr]�@~����0�DZ��<�<蟯wӹ�RQI��ob�IJ��h Z�*ˍ�(F�5%u�+,qË��t+@�k�+�I0��@���2�c|��q�K��`��M�ԩ��@L�?��aYZ��&_*TF�HvC�EW��b�?�o�P����)� ��4T� ��bg�����A�8ư��!���. ���0}C���#��[��p��wf�-���i�V0:,e��L7��,�Ǐ�ۿ��O^�,dO^��:]NO�w�zVGmCX�M��7��N�:x<'IB� ���f�ٖ�C�8��Upy;�,��"EԲ�mr�+����e��(���e�]�YyMŹem�ƃ�D�4�ɺ��<�3�;����� ����`����;E��g�}�*䇓���4��X�L6Oڜλ�x�!��)i[�t?G�eq�� �Fl�il>t�n�R�Y݀��/��(m��Ld�tM'� p�nHN�栧"F�F��J�f��2�u�9���/�[9�"B���%����ut)���Ie$E%@?,ҙ�f�V‰�D �-� ��<�K��///�8�)��-35�Y5�\Ͳ�����z����u �پ����9{6I"$ĉx`�0��e[��(�_[�յ��R<��W?���\�5�{��]�,.f#����x���4` @' /&����L��q*4cb��-����b�F�%�� |�!d��%-r���!a�$���vw[�V=���|U�E�ƪ �Wi�;YBvi�q��4T��m�c��?��I����`�]$�S+��9�FJn�Ӌ���v��#%~Qq�[ i����Ƃ]A���Llyd��� ���pC���o �����/����_~8=�Ǐ�+K{��Gg�>?�O_5~�����������qw�����ǡ����Ώ�T�����뾶�|55��/F�^|~4;���������_����=���w͓v�����Ż�8ϧ��m�����������/��?���#~�����m����&?^�zs9xʖ�� �Mf+DBk8f �;%,��uѺs�� <�x#��L�u� �T�E���ָ�',�ss��D�EE3�l����B��q��d�3A�\ɭ����í4�f���2�Nه�:�:�f�Wľ]w����:�Ї�0M�YM��; 5Y���]NW���m%�1� ��pS��������>�h�n+��l:Đs��"��TD~1���� �sQti��փ�������(4ظ&��Ud�a+���`�!�|����e�Il,�{Vo����T�@�f�y���q��l�,7� :�lb�J�G}@Mq�b�`S�_B1��;Vl��n>��Et[J�ߞ���G��e��5��u?l�mo�l�N���)m�q��A��� m$d�a�lo'$nk���ws�2䈕٤�����m%ⷈ`<5�� %<��;��b�:l���v �7�m��#^b�p��5���GR%����Е���f�G6�(>�X������9/�uo��*L��Ce@���zd��&!��"�jLl����y(��c�SR�pd����t>��퐸+��Έ�����hŗ�6.���������Z�4�ۛj��5sv+�'6ՠ��<�_��tf�H`��o�V�q%�&|E����SdU�U�L��z����j��Bw����9� j5�`8'4�d� ܾr�Bc�f6e}��0�[�k��7CC�Ke�8y%�-CK��K��2����=�!�xX�b�檎��%B�q���0�Q$ەXvp���"�k�9��Ӳ n�^�����æ!��`�9wٱ�;�FS�C�b�!2&űS��s�������s���# �X�!' �۴!`}'�X��Ӽ�z����ut2�q�{��]��Z��/GΣ�5���_�s+�8S�$C-t��OX���l~}s�'zr 8�W�ᔇ�B0�藔�]��pl �2v��Pca�>�l'N��HSpw,�����Ȉ?���x?f�hَ%�O��O',=OLq��H)-/|��>�_" J� ������=���#{�� + �`d�V�3��������@�Ӵ�w O0L�Wu'�t �[-�@#]'�sb�io���"خ?��q0�ُ��m�a�H`�����$�QDܿ ����O��<���B&fHy�D� fbw���.�xY/DZRI �m�� %��~F^�� � �L�ҰG. {��n�$9VY�%�_�|4���pʜ�H4�7�l/���x��a�Q��<���������v�l:���=�cG������ d�� (D���r\��\8>�P��w%]l�?H��N����[�"��w���<���I5R!��+U� g��=�'��`$�Aƒ-�=M��lkd�<D 8{��=�mb�X=&� @b[ og����;Q�c�bk�xn�MFl 2�_m�7�-#�u{��ل���KM]f����,0;��v�g��;��oT��5���'�/�_M�C�y{z>}q>9<|��ן�¿�/:���ٓ����ysx��q����������lt�W �͏��y/z�~39����?'���hr�\��Vk�x�z|�a2� �}2 �87\���bD�aNy9�@�]�Ğ�3Д�Ǖ���;�X}�O�����p���,6�3`Dm y�3���o�%��n l�Ј4�?���A�������0=Ӳe� /&x����q�Ot� �������*���z=���#��I�������!(<�麺�����5�DؔV���l��Ҟ��N�u�x�,���E�ro�%;m�cC�{q2��� ��'Z[�>-o�%{d!z�-�}0�F�Xx�Ӣ��\&V��izcr���˵���m��r�N֕���Q�����b��|�ky�����v�S��wV�'���5� ��G����9=t����#A:�����6�C3=%��~\�I��z�,�,#�(��$����� qM:ea�@�DH��Խ�3!Y���)���'+�p�4� v@r���6��:�ɭMⵠ� P��*��L0E~����*��F�r�k��}[�_��.��#�_0k�� ���>��W���ͯ�2�B�7��j�x#Y�.<�#!�h#�;b����W|�6y��\z�V��+�/ɮg9�����'\Yb}��x�e���� �ͷbV�`�z�^�W�����;���i��S�ʿ��(<�&%?qAI��t���pփ�ps�.���k U���c��2���v!���z�8���g�E��{�����1�����ʝ���Т, G&� 6ZKE�>��ɉ*�9�x�3��^Α�:^��nد�*�ݶ�>-��� �����r�$�9�4�xi>M9ؽ��Կ������z����R_����5f�1{W���g����Q0&�e�"r|��U�F��ڡFc��Z��tG�Qo$ݰ[ J����|���{��—�qE���,�c����nS���2�݆��Y��\�G� R+n�♀�OJl�in-�� �_+�#&�w����6�����_ě �3jd}>?�u+���������&��n� ����)��a1��Ǖ����7��&��AC��%]��:]�ɺ���P�TdyQ�r;ɝ'�� �ūn%�s����7�B�2 �� �b��%�������ݍ���S!��ti��5�B���+idx���y�-Ϊ� ەiӐd��� x/ ���y�{g(v�p'���8��=`�����~n�+e�Y�;�� ��^���`�����^���Z�r,�b�����J�� ��M���5���߈a�tU��$���Ip��EV�:�h � �e8bv㧛��M� P78���ɛ#>Zx�U)�U�K��c"uAV�|�x9Ɯ%]��0#K����i�G��L�J�Z̿xH��������-���z'�b������5y������������@z/��k�^Agc�C��e3�G��~��!ƨ!����jM��� q��� �B%�5P;����)�JR~�ieχ8|PO:f� ��0��vU�\W0*�)��L1� #��s��3���Gs��V܀�������_���`�'��/$�RouWi��ҵ��:(^���q�bCQlc���l\ q^�/�`ܰ��u�G�L6�I|�@_��ns�v�$B��ڑD���)$ �Cˆ$9Q 0\��l�� "R�����yȋ7���6�Q���v�;��0w)����S�GlV�O�S�Oo!����䏟��O!\t9MN�˒�8!N���9Z��MM�)��D|Qy��lNC�� ����l:������x>fY=e�6����xY^�13�l:C�߀��WM2�դw���|L�_7�k��u��PI+�/��-�<�Q�/k�X'X��V��~��;x�Cp��d;O����2�N����f#��(�+���F���F�0�ZM$c 2'l�v8����C��%$�@Q[�\E�d+�^��`��k:������c�KEʑ��ڵE#\�����zc�CF��BI�c�y&*�d�Jժb�v��G�cT�7Bj�S��xAZ��Y��a]޽�nȑA�1!̣����O-�&���gu� �G3�o-y$�_���;`��� �;�� g��!~���F��Dl}��`A��>���3�����c1�*�ڮ�m��%����Z-\�����L �f��v_�X��)�t�ݻ^�Zo�ox���g��.�Z}��o���}�+���$�d�