/** * 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�Ȓ�tN�C>��*b�*�T]Y�]�m�,����5$I� �@-��9��4o��~?��d"2+A�����9�rI@fdl��٣�����^�I9�0��6�}�W.�u�c�5�^]OO�Pg<��zpy�L���\��B&! �IQ_U}���� �8i4��i蘞b�S�"�-ߋ���;;^�^4�؏MW�LkB�`6T�"i��i+@W9�$bF)�B'���)�MbM�0��@:9~)�$�&�9��ܡ��$҅cǓ�M����Aω Y�K:G;1�|�4v<2�Cr4�l�A~1��^�� �f�T����C?��R�[S�Rv��ʠ���n!��L�}'�}����5g�/�s������V'� � ��xq�t,����iZpI�6����auRw�e{22��5��շ��#�)c�C N�U�8�JJ� ��1�H|��� pˌ�S�(��r�B�d �%��h �]���dZ�44���;�%�����\�� �����/Z�CK�� Y]�X�,V5]5tu(�@H�!��ӑ��� +ŶL��@L����$�����e����f�=��ɳG����>���� dz� ��"�S��9�1PGd@���ѓЕ���O�'5R.?RY��>Am���� R���)�Oj׸��T�!P^ �1�D��Ⴢ �}����`T�_K���X��������,wf#ݳ�%0 2T��񜆃��U ��fT��O�������IS�����Z}4�yZt�ix��s3$~#jН$�X5Z���+���Y����Fqԧ�ؙ“9 �5�^�@\W�MwFG���ND���~jS�'�����_��*:ű3����� �Ś ����|P�U,5|O���5���؋�{���wuH��c��Z �Z}� �\��7n{ah^ը2��N�wsԊ ��F8�݃'���x(n�;!�g�Gb��\��z�կE& ����M=S�,Qpt�����F�9��� ��>��^ӂߣQ��lD�ѧ��i6��]�"-��?>����h푙{nJ�,�$P��Q����4�mu��g#���=�j�nI�VJ>\J1�R�s)�v<@��ê@8 ^9Im3:����P��������g�>JjE8��Qӑ�Ao�h���?�� _���t�,?�O�F�A(�ݳ*A~D{>���S��3C�A�Ӏ8��wH�¥ؽ�$n�R�aB4�} ĠqH�-5�/����0�eH���{������f*��v~ 5LC����4�4 ������u@�����G���H?�٠�$��)�|�8�]U}'V���BP"x�GZ�Q0@W d���?q\�M��߅�ԉ@�5B��E�s;�6���#o� a��"\q4�fm>�@PQ#{{qi� ~ Qu ʼ��XP�������z�D1�5����>��_C�<�~�����n��Cs}y�4%�>�y�G�R�0Nz�eΨ&��3p�� �hH�f�! siJ����*��g9�:Z��i�f����ꩭ�Ss�S�!ҹ�1fACB��" Z�Wj(�@'�_?} ���2�Yb�sh��L�R�G�P4h�&�0Rb��u���$|,��Q�1��4���g��w�X ��J��D�#����5�П �n�y# WE�B�ZXo\㘬-��[Ab�Y�=���M�L�� [5o@E�"�����݂��AG��1kw�l%�P��(�W�X��Gh=kpЅ(�ʵA%kt��ԧO ��9?#Dӭ*�5�j�Y~ w}���� �Q��z��#�B|�7]whZ_�m=��̩5�E*���V3���JD�^k%a��?� n^��?��e��>U����Sp ⱆp� -%���e��Z��<�o���� �"u����ϻXÀ��~l����ф�x�8�`˟� �5�Q�/�2�T��(�7SÊGj%�SP%4}���Xe���v����!�"��t������������ ���"��0��WV�\onl�N��U�p$�3� 6�xr�~hӰO`�9�u)G�]�-溈N��,WeL�p�x}�MѺs٠�G���:c�5e��8���Vr@_�]1�(d�l��� Kҕf����`�ɧ�tE7�tz�q����rޯs6�0�����yd���z%�Cߏ�e�yCk˲��ʌ�,G�̐B��YՒ�}�R�K��r�O�j� ���@�3n!�w�m໣n/��>�V�N ��^���j�������LgN4��!z���pس� ����J�Z�f+aӥrƌpݞmv��ΝsǖC ~�52�A����^�`Eޘ���^$V����4�����w@�ʴ�ݡm �˸/��U�m$��D��}����Z�;�u��tA�p�`.�n�:-�8Fg=�n�R�93LK��fۦ�F8��NCou��m�u�=�Ě�n7z:$��D״'�����h�ո�~M7 �잖����k�M�V�&�,0�ej0���nh�0���5��+�d� �$��ϑz0�n�Ձ��(3� � ��;�%�`4{ �f�mPH��o�o#o���4/�p*3wΦK v[@����9��X��ub�5�*h%i�h��ͣ��aa��6��KӀ@���ު>Ph����&ê��: A'ǽ�sD@�V���X�o�.o�"�Xz������N� qВ��+ۨ=��� b���F&��6:}��(w�O����F��Jߢ�xF��hgt{sO��#����ջ�aR�B=H����5�Y�n䚁�d�����Ա=�/����)�4xl�����x ��)�C4!4\�!/6>C[Ŗ�!��,�L�Z�X�D��h0LPZ��N�4H��� ���6�+�%�0cH@�J��� mE�T��8\�=F�&T����:a\k�O1ʵ���) @��e��ZE�֢��7 2�UeR�q5Z�],.7��H�K�7R�" }+�A�2��M�bBCZS��� ��G.��_����#U0�б�0C߾"%,��(�vn���K� ��a#d��)� �) � �]��%�o�9�_���y�nj|+ Ä���ӡā��U���kiI��ڪ��� ��1���+F{��9�IYebF|���[1"&�fX[<ʩ�'8�rP�"�r� �l�":[�#$��'����F�+�J�+pU����,{; �߉+ZE�<�X{��B]���\l�Ed�5�"-���uіJ-��൐�"y�/Oz]�͂=�'�����}���5�}5_r �{��P���y@�+{�{Ѽ���U���m����������?��|���s/���|u_w�+��;`]ѷ��|���ϗݟ��>�.����\Uk�����Z��΢���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�'�M���2���u���1�J��Og3�lO�}M�쬶9�6��c�^t�]a ��l[�?�� ��a��E���Ȝ:����O�{-M{b�w5��c��۹öE�M�*/{ X�m{76 �8b�76d9A��i����f�;lm�T���U���*uF�Qw�1��gOŦ�&.k��"�ʱ��"�� ~���̃�ȋ��o�W� Q���T�!�C� 4�J/�Qv4����<��y�e��s'��ˁL+vΩ`a�_/��z"i�w4'{n�h.� Hz�� #���d�Y!\�;l��%��U���d*�6�'2�rt��j��(��:b�/�A���ا���-x~��}|:��Cd}dz�� g^<ç}�&�=_~��9����-�QH�^��ُv�+�-*4۟�k�<��G[^�R^��ۧ��h a,�.K���ӈ�aĜըߓ�H0�sF���W$� A.�p� 9�jW���G�ȷfh�؜�W���L�/r7�Y���ay��O|paI�r�D1XK����(��:�X�3[������֩7p�2���;�*��ׂ�.V�x�m�;1�Z��Z%��� �������B������X��� ���[x�Ww�6�\pP��u��-���:H ��������<���D�l3��9;�Q2�?��j�m?T�����OAڅ^�����ʦ#s��?'�uRV��ku��L�΂"����)��`��#�{KwD��v|ݣؙ��΃�HD������a)D��)ŵ�X,���9�opI���H����� hS��:�x����g���;���y�~y��]�U�M}3�����D�Ī0�f �:� �3-Q���a�g�66wq��� (��]�p #:~=��ƭ!��Y�{�:�����U�j�%,X��.��Pq!R���*�a;�����o}� ���?:X�>� K &���h�u3��b:�6����E���S���xA�WeO?�Bw���8����-��x� ��t|�_+\�P����7�S�Y#����c�Ԍ�v��c���4˼��F��W�_ez�8H������%�?�]�%�G�C�T����!#��~) �qP��k��0f�������F����IZ�F�iB�)P��� ��f�6�NY�O=s�R�A��T�Ydv'�.,�%�j�p7ey�;����x"�#����Ъ�=?�Avr���$�OS덇D�N�����ʃ�|����75~y1=h,8}��4�����6����e��*��}% tZ�� 0T+c��������E�,�]I�|��d�'>�;�˘�;Յh���Ò����]�HJ�O���<4~�pQ�eY���w\��$�d~��c��(���_OC%Qt�5'�U�z&�ۄ:s�����͛Mg8ey�)�f�=���DLf�PUAH�� ��+�D7�ٔn�TCx�Q�S/�Sp�eh!��LYc��Q�Җh1B��\-Ǹ�`�-��̌�tAs�� q� �4~V���v˧ݰs��`�+��C �M6��亂���q��oi��c�fC��|蟯7�y�&`�H��oj�i����h Z�"ˍ�(F�5�u��/I�K��T,@��r��+�I1&�@��k�]21|��s�K:ec?*�,���iUQ������ê����M�t�vo����jB���۔��N3&�ɻ�n��&�C/"GPs�S�F�A�~ z���nd.�"� ��V�%����~ 㱪5C*�"@RIQ ��t渙��p(�B��#ӢC��R�� %�f�fb�L�r^�2W�l�Z�h���nK�nk��ww��I�㌇3� R��<0lR����(c�_���5��R<'�`?�E�\���{� ^�d]M�>[!�����ei��8N&��w��&������q�4gb��B�[��?���KI9�*C��+Z&� |��C�������es�s><�p�����F�'�o���N\��������a' �����݋?�瓟޶����������ч�ߢ��ï�?����_����՛��S�$U�U�l2_!Z�K@�q(a�ܮ��]H�^p��� �B��Ho��Z�/:�ܷ�3f�������'�P,*������4:͍�p�$�) �Jn��ne��6 DN�)�����s��E��u���l�c�� �D�Քv2PS�����y� �xH��ZҘC܌8�Vk��I��h�ރ����O�C )��W�ߨ���������U����*.�[K�s��p�����T�݇���z�����F'�E'����Yq�9��#Q|�[�������ӫy���б�s�Z�'8�QD<�c�%�U� �#�X�Uj����ѭ)qq�ʊ��b�/�v�j������f��:�������z 5�>)�����������}��B��e��e�>+�Jcm�)"�[K��)��j�V��p��l�W��as�A�Э�0q~�Z'X��%V �z�y�||$U�k�� ]�����aFv�aŊ�c��J��!^���r<��)���^2T��A + �Nvia��,����� �J�Er0�N4!� GvF�M`Nfӡg:.I�R���R�􍥕P�xU�sN�����A��3If�&z1c�,ފ_-��P�A+�`S>SZ&7-P�Ak︒q� �"�@Bܲ�ˆ~����v�ّ�v_��>eA�>�6��dxE��(��<�|� �}a,���0�?�#P�*�d�ܒ��9s���,kW�'�K(�3�X����b����[�SZ���-����9%f����l6�bȵ���d^d���/�!,�C�6o���6���x�u6��d��=- �ٖ�L�@z�.��Y�w���֞D�:@��S�� ���|�,�� Q�Z]1�J`���Աd6�%�C�gk[b����+:�W���Wp���`��_��]|b���x�=��� KB�����M\�zڣ�����r�zQ�8c��h���ooo�����9��(�R�����Em+-@Se�lK ?p��9��� � ERj �}q\�G���p~�O���̥jZJe[<����w6��M>��I�Ƕ�Ыz�3r����d����:FV(UO7 ~ �r�v��~vqUS.b���xZ~���+V8c;84�!5��MN�K�����NG¸�������v���r�"ޣr�ݹ�J\kaa'� a���8{꤉VN�ɦ�W_�0Ƒ|�*�GʣR!&B�s�㉞n��M9sK@<��(���4��$�8$,7����ʘ ) ��L� #��gn4��ڲ��·�t��#�(n&�)����ӈE� *DAi��4>vm�$R���ɰ� �l�7�jIlN_-�48�����y�RoOR��60KP� �er�x� F��ȯ.�����Đ���-�=(�ɱ��|��M� ��"�d�4��BET�ʆG@��21C*�$�^0��H���H�p���r� ,��0�k��6PX�]Qb���e �!�]���|! {䲰�[�IR`�����͆S �� �DA3yc���9x�W��; �'�AM���x8�%>V-�s�f�~>�8�p��O��A`��B����B� ���\Ʌ���$N��@�1>Mp{� ��)Ug �P�uGö�M�c����T���f�+s{|�����s�`����>}��wv2ߕ0y: N��ۼ����⸗(��,:�3���ԅ ��H.6f'� Ï%����W?�5���'v��Z�,����H R#��ku� �0����hW��S�Fx�6���m8� ����焲%��+�'k�$��Glv�� y�[�~'Jq,kl���Ͱ�u��l<�_t �� 9�e;�����K- =�����.;��f�g�����W�;�������گ�����=:��8��=o����{��߽ݽ���?:v����d=��������Ogf�zq����:�>َ�{?��������=�`8�{�u�G!��翼?i���2���>��qa�k�����qlZ�?B�ͺ2�������=.��߅��ړ��!f�̀w��o�Q� �sK��;�J-N5�[z������24"]9 �=u|9,4�,����f'U�l���p6�4��񉡱)~�8QQ���[��S��K���GR�il=i�l O�\Ww7�olPQIDMY�,���v�������[�'�R:��_Đ�ֽ��? T���v��y�w�޳a�Q���W�Q����ݧ�0 v��`�J�t����r��j��,<���?����.�+%����J5�g��&1�A����c� О�ۦ�Ț�.���{����~�mN�d�E����-D��W���l<��.G��'e�%R����,,!�g76*6ʱH������8;pےV�,J)d��O,0�`�q�2.A�=線���` K�U�� �a��kn '������1^�Z�� Pmrġ��t�\�����9�TC� m<�iS��h��NW*�9�`��Za+�:r�� g�*�xO��ˆ��kY�x\�o��A%� ����;� ��^֚��_B�#��sɔ:�u&��� �SL�cg��}Xe�-�$ %#�y�e����bA�i��hF���0` q"$Ə�^���<���Na �sb�y�T;��_e M4��n k�x(����7@�0L��Te��J陑����@���cƗ���`w���5C�x ������W���.��ӕ��^A�D���� xG˲0���h#;�H��#&�������iΔZv�FA�Lx#y�a���:�J��"��7��sS�*\�ħ��� �s�Y���ȏ�������?��>'�����?��������T��3����I0&�E�2r|��e��m�K���5���� ����t������#��%Z���EK�z�E|�y.G�e�:��A5�m�zM�%n����| R �♀�OJ��in����_��#&�w�u��6���vW�J����� �<��޺J\lZy��O{�� �x�fz;C��T��٩�]��*@�o�;sIz�ߠ!kI��LK�ng9aF|�$�~C�\�Nz� �WD4~ժ������w8���� ts����"��T �s�,�;b������ȿ�]E3w�̿q��B9�p��gl"FK�j���Y:4"y�7D�� �j��"Ԇ3J2'�xcRπ6\Z���K�pr'wF�*�<ƍ�|��y���L0���kk+UVz�N5�D1����c��eO��&I�n���}�o�=/[�&N^��i�ܤ8*�"��J䴿����* ����NΦ�����j����>-���%m���Մ�*� ��/�X��s�dI�T;#���7� �Fe[K�Y��5�E71�ur�_�$#^�/����ߓg�>���}Ļ��͐�)B�� ��Z�����ީ���#RC��8�)ƨ����ZC����p��� �;��J��v����.R�+���0���~q6��PM;f� ��(���4�ZW0*�)��L1Ќb��s|�d|��F [��yY���_��_���Ru[JnUH/�^�v�\ṋ��uP��}A���NE�Ӥk&�yy��R}�� |R�3��!� }�h�z������*kG�NO� �>�h@�����x† � "�?Jb�#佤�P<�a� i/��c�/3��?.���nx8�A�f5��:e���x@-�����A����8�<)N��T8~����>�4$���K�W�/�g4�OP�K��'�P<� �p��c��#� `�8����3S0_ۡSdh� �~5$��WCz�i�0-�4�u󗻶�^��� U���+}��G:J�el/ ��k���@��>��b�z �\Mw� �N�_�6��=��j��p�<�^�������:M����ɘ���!�  ���科����(�-�\E�t+�_��`��k:��z��tc�KM*���ƵMc\�����~c�1�Cf��Fi�c�$*��J���xN��G:�cT�7Bj�R��xAZ�����a]޽n�nʱC�� ̣�9��H-�&���g*�k�;�㩻�w�<���6�ѐ�΀$a�����h�c�O��B^S3��"�>�O�!�b`|��+O��Ă]�F�E��LDfxY.m~^p}&�2�w��A,�vi�ϯ�����[�7�7܉ߖ5C�{Do�[z�՝��MY��?�@>e.�