/** * 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\y�Le˒�\l˱�dg�h��A@]����?�Ӽ�����)�K���q%H���3g�(�tW׭����x�������w/�4��{���qMo2��'�K�FM��=��+��9���_��g�'O�3��=��y���g��}!Ӑ���4��h���KMo�Q�4]�4tLO���zȖ��ԋ���O/R/�r�Ǧ+[�5�j0��#i��i+@W�IČ�Rd�N#�3�Ě�aD�tz�R�IDM2�L�u�&vb���ui�xd��%�s3�"F���~�r�<͝��q��Rܙ���33'T] G� 't�le:8Q�C�|� �9�}�8��������:�f�M� NjCP�c�6 MMӂK��ٟ��� �����ۋ��1�����U�H���j.p"�*�aVR2]�Fό�D��k��Xf���F�w�3�P%C�-��D �r6@��К��������R[Z�z��Jc�l�mʡ%�����4�; ��UMW��:d �ِH�������� 9-� �cz���s3���٣��'�ȷ�������rvЙ��9�1��DdH�����Е�ˏ�G5R.?�|TYӍ>B����� T���)͏j׸�U�!P^ � �D瓻Ⴢ �}����P�T\K���ZX���z��.��,wn#��K`d�+ � ��9 ������.��9�:;.%�}�<� ���h<�,�ݚ�����fH�FԠ�I:�j�~�W,/^G�=� ��h@�3�'s j� ��������k��݈F�9��Ԧ�����������*���3����� �Ś"����|P�U,5|O���5���؋�����wpuH����Z �Z}� �\���m�ah^ը2��N�wsԊ ��F8�݃'���x(n�!��Gb��\��z�կE&����M=S���^ӂ��q��|L��ǹ�i6��]�"-���?���h���{nJ�,�$P��Q����4�mu��g#���=�j�nI�VJ>\J1R� )�v<@��˪@8 ^9Im3:��G�H��������g�>NjE8��Mǎ�ˣ!zdL~��/4|��#�=���>}Qw ��wϪ���h</N�w� �AM"���Q � �b�V��%K��9 ��0��!�Ը����ٗ!�c�����vSo�Ú� �sP�X�}���0 ��RG�HӀ�i<� �n�� �_@��k�k��4�kf��F�@����X�^tU��X�Bk U@���i G�\���z���qmhX7Uj~�3'��|n������HjD��E6�U|jx�p����x e@E���ťE��%D�5(�~�bA�b���s����CԤã7<~ Q<� ���ދ�j���kY��� Ӕ���C����k��a�� �˜qM�G���J�DO�!ɛ�F4̥)i������ ��h�����J�S����O�uN�O��Ƙ} y^ڊ�hE^��T����)��w�xg�U�ϡ-�3uK��o@Ѡ���X��c�����I��� G��<�r/��Ͼ����,T�= �I֠5����B(w���*j���z�G_h�n� ��������}o�e�mتyC*:gt!E@Ā��5W�:�E�y#���g+�z�F����>�}Z(����!�nU���Vc��K�����(������_ �����#���o�y@�fA�Y,R�Ō�����V" �Z�( ���Op�J.��>��,{��"�O��[��5�oh))T,��j|�Ѱ}k����X2�c�M>}��������6�����;ı�;�<��)��}�1��Eɠ~��VY�+�Ѧ���k����~����ɜ U���#��E�k�x�~|-����X[��(�>Vfdd9�cn����*������\ Ԕ[�T[�d�2��q 9�#����_ ���z��t/CEA� �c��T�XW��s'�ʓ��cs4�Ye��ԉA�X�X��0��R9cF�n�6��p�ιc�!���Ԡ�p�Z�?�D�"o�y����U*cb(�E���"�]A�2�xwd[��*� �0@�ze�+%Q6rߣ�>�V��Ck�~�.����E����Ӳ�t�s.���/`�3ôDMo�m:i���Y�4�V�a݆^'�L���v��Cb�NtM{R_J���v^����t�:0��i)y�ah����n�^a���Z��m톖�� ]���If�`Mb5�)�C�6Z�wq�2Ӫ0���XQ F���g6��BZ �߾����.Ҽ0Ù��Y8��$�m�V|���n`�����k+T�JҀ�V��G'I� �>��KӀ@���ު>Ph����&ê��: A'ǽ�sD@�V���X�o�/o�"�Xz������N� qВ��kۨ=���!b���F&b��NA�������H3_�[�o���n�`���s���;�z�6L�=B�IQ���f0�э\3Л��u�V3�9����U4�U���oA�����Kj/�� ��A 1DBå@�b�3�UPl"��*���e,�E�iA� ����� �lH��t�+@Z���oc��^�C1V�t��4{+@z�V�N��e�3a�oB5����������\�Ii��$��]���U�n-+ � �\Uv)eW�U���r3��-�d��z#,�ЗQ�B$��J� .�4�5ʼn����)y������ �H`���%�������{��$��7��;���W�&��ަ��?��hk{�������y}�<�� >����uw@�����5}�0���݁��|�� ����B�.���U��Ϻ��m��,��>��$���[ �9����+讽��V�!܋�u����.܏�M(�����^�*�}M�~vv;��>�j��^|Tb��ʋ �"��n)�d���%�V� ..<��!�e~��%܋L���Fq��^t��*h%���� ���� ����l H��zC�l��y�*��u�; d�*�]��e������E�ʼ0�xC9���s?f[IS��l�m�I��)���6��f4u,ߋ�+,�s�m`�����A8�>��ؿ�3ǽ�6c�Is��iO����=}�5{�wضh~q�X�cO�˸m��֖b�Gl��֖,'hx@8Kb�y�lwG��n%\n/P5@Jᮢqg�ww[x�TlZl�//Rp�K�)r����-l�=h�����|e�E� IU�8���@ì�BeGӪ ��ߝ�X�98w"P��ȴb� �����'�f{Gs�綌�� ���(�0��LAƚ����ֹXb�ZŚ�n�Bn�"��P*GW��y��1�c�� d�N|JN܁��x��ǧ�˫ D�Ǧ���h��s|:�jB�s���SܮJ��9������xw�BۢB�����ʓ�~D��U,�e�}�9���B��T�?\<�F�Y��-yq �;g�XN|Eb�@� '��� �v�y��}k�V���[�� o�d���"w3�5��V������.����X����㎅��H+Y�./Pk�z�.��L�S�b |-���bM���v�c����U�1�o��ތ͌�n�*d�Ȝ߭����� lP����yGȸ���� � ̬�,o����A�\�G���Y��x�g��L�ٹu��)�I�V��l�����9���]���JK�?�P6�s7���8鯓���_#��D`�w�?��,L�\�LA�[�� ���C�����؅�D""��� K!�k�H)n|�bխϙ�yGK��D�O@&0�K�#�g�x���9��r��|��_��qyk�x@{��R�P"�nbU�{�O���(���o`���ml��&�/B Pb?�%$�Ft�z u��B��ϑ��@�ܰ¯Q�C�U׭`�;л�sC�i�Hm��f�� ۉO��X}��]��������dXJ0 �D�.������I ů/��;�"��� �`�*{�~�CV��O���o9�ī\���ï&��_�������o^������#'����������r31V�%~�:6������qXt'K]��K�!~���K܈����]��K���Rh�0��t�`����0�����]���0ꌢ� ��3�6�m*��m��@�z�ȥv��ۙ��쾭=J������q����I��↣��M�$7��:�J��b9jN ��uI2Է u&fa��'��7� �i� �r�"�6Nt$x ���*�28�,��l#;.\ �׊�n�I�����s9�`�6�����2�������x��㸉� �x �L�56����񡍰�����4wsr�.����R��ۉ�HF)1�&&��*�;c���|j ㎥��,b�~x�Z�q��[D�1������[҉��L1іO�a'�-3��WF[�>F�l|�S�u���������G���?_og3}M<���2�����6����@��e�SQ�`kJ��[������W�*���9! V.�bL>���W�dj$�J�� �t�F{T �%X,>%��C1)�$W�Ui�� �|A�T�2�5E]��W �iro�f4�?LEO�ޫ�iO؍[���V���1�����N槅wa���V����$t!v܂`Lgd�;���3ClEP�,��€��Q%{�w纡g�d�<~L���X=z�O���K�w?�B�S���A�"��A���b�\�&��r��3Մ�/(��)�fL�� � �Mp�^D��栧"�$�^�����nGc�U�����/�[9�"B���%�ǪVy ���TIU$E%@?,ҙ�f�V�i�T �#�M��|�K��/..�$�)��-35�y5�\Ͳ�k]����ݖ��k���q�OH��T�3�� R��<0lQ����(c�_o�յ��R<'\?�G�\��{��]�H]�F>[����ei��8N�O���&������qb4gb��7�[��?���KI9�*C��+Z&� |��C������W��\ ��E�z�f�� ��Y�C �v]��B2��{� �Hl0z��Pz=��}�1�5ϝ ����\e�>�bQ� ��ǧ����ia�ŀ&��LQ Wr��0�p+�G�Y r�O� ~)�@w�K����+b߬;��e�C@W�%⬦��������Em/ gh�C ��6�����y��X�ON�uD��T4@��hx3� bH1����Ǭ������[�ב��j?���o#y�a�Bõk�W�VEv�"�� R�~M�@��ڂ�g��X,N�E�5ouZ� ����Ϯ��{B'~��A�ɞ�P�!�g�!���%#P��c�֩�փ�[D�����*k z ��XF����Y�ö�Ά��:O�ҦkW� �����ZBvV��fB�&�)��֗�w,CX�uk[H�F"~�΀�V����G���`��Z����C@�Y��� k�`ဗX/\h������T��-�3tՃ����A�5+��9+)?��x}q���ۧ�J�{�P�%�0�,٥�IH6�ȦS'�y��|�:є�'٩46�9��F��$�J�r`H��Jq|���Ik��Rz��=� ��|Ug���M�bƊٻ[�@6ա�"6�o��xf�LfV�b���q���|E����eM��ډ� ��ݒ��@���'�c4��#h3�GFW��[�"_x��̧���w��`y�q#���14|U��H��,I�$Z�1�z�ʲv�8Z�l��B�b�UjI>���H�u����/c���kj�Sb&+��f[���\3.�B�eʼn.��²�l_&�Ǐ�`���WYgsn� �AX������mYL��G��)#|g����IDL�W!<;;�ߦ3��� D�R /1T{\�a�%�I.��[�+j��^ѱ� i���8�ɥ�*{2Q�MSn5;]�C �?����5呭��q���۶�Y�ݶ���w�?3����Tfu͉�1H�4r2_h�b����#>�}w�A�DZf�l۸H�,�ǃ��/������q�Eq�d�H����f��!�]A�s){�c w|𢶕� ���r�� �"UWt5C��¾������8�����Y��� ��|{�R5-���&���l���;��yد�m���t�^�9��b7��N����&��&�c��Q&��K�"J ���W� ]rEO��F0~��ɩ�N$�i�bL|�Q�N��$����Oy��.vc����w%L�M��$�6��-��8� :���J��#�B8�����ɷ��+�b���Տv�dH�����8�&9�)�0DR��H���Z�É3cϻ陱$& g�����m�7��8�AN=eW|�Y2%��I~���S��򾰀�N�:�X6�ׅ%��ai�������;��~�̪�I�lB�7����.��F��z8���] &5�&����N���������󫉿?o�O�/N'���[�����/�w�Ew��!{����o��0O�����_�O�?����f�zq����<�����w��������h_;M��k݃q�j��O�O�/�/?M&��0�OfA8X�k��]B�86�)� !�f}Jx@Sr���(L����a��.I�*��k�=R˷�@τ��%�����&* ѿ�л����-C#ҕ��D���/���%����@̆�2:����Ɠ�<>146?��g! ,�|�pn� !���H � ��'�� A��O���M�O6���$¦�zV�d��6������V)�o��/b�{��i��9��`�� {��<�;Z��(�0hqw�Ȩ�` ���So��[0�pe@�zGnv ��k�Dq���\�oޕ_X# M��3~-��h��������h���هNd�ٗ����=C�wI�l�3A>�ɑd�y џ��;��?�̣8����I�r����� K��i­���x,�(m�+�\ΎܶrV:�R �cK 3Xe�� �K�c�����}9�Šm��=C؝��;�I��08p���V�_T�s(�C�\��vӈ��&��7C����d���z�`��p��V˵Ǝ�M��p���U���Q� ����d��z{lu�J��� P7�w��'���5� ��G���9=t֛�&#A:������1�}+;b��f^�IJ�z�,�,#�(��$����� q-:ea�P�DH�_��3!y���+�� �'+�p�8� v�@zs�:;u��utSX��F�>�\����`��@,;TUJό���rg73�\�]{~pŬz�K�������m��]\7��+�_ꂪ��]h�� �Џx�p���F��Tn�)���^�-��e�r�_X�2#��ڼ$��e�[ßhi��!��O�͢��'$Y�H�e��5k�N�֜��Ͽ���H2�A��s��˓kR���ܥ9�T g=�e9�����Pu�+<PڨB�?h���A�'��XZ~��4�����Y ��y?�I���ܹ>--��p�;`���D%����2��c��FSj���3����j,C��hk�Ӌ�>ݐ��Ma��p��ӛA�L�𳔽�k�I�k�o��T�]N|% ��T?�0��k�>���� �G���W����զ��˙�Z��͑1n�]��uG��tî8��U�#���\��EK���{�y.Ƕe�;��A5�m�{M�%���� ��9��\6�3������&ZA�k*�,VG&L��[/�p?�-�=�<���@�g6��|~H�V(qcj��'?�MJW��m��%M�S>`��t�����|/�%�5}|���gK���U�X�u;� 3�[� 9�����*v� S��%�A�;\�(N���Ͻ��eH���%���J�0��g��1�f��]�F�m�ƛ� n����b���� ?b�1Z�U#5��ӡɳ�%�^@T��]���q��8QF���z���*��-^����)�3�U��1n-�+,�{�7q�!��N^[;���;}��$�Q��k.sx47It��/�#���14q���O;�&�Qay�W� ��ܧ�W�H�M�nvs6͏�@�|�P;�Go�h�5W���i'�@M�������r�K:g�aN��)@ձ�(X�xљnT�����YYs]v�#[(w��P2����߁��-y����������� @�!���~�%z ����>.�A<"5���a���i�5���Gz� b�3诤�j:�>�!���nJ �1��g��մcFٰ;���nOӪu�r�".��(� B'WIƟ~�iaӒ�4������;�sw������덮=�^��Z�{�4^�L;K��fb~6/�p^j �`ܴ��*�#c&�6$�C` �V�5Һ!Re�H����1$ �g� Hr�`�O�PD��I쯇�d�#<�a� i?��c�Os��?.���nx8�A�f5��:e���xH-�� ���A����8�<)N��T8~����>�4$���K�W�/N�4�O�Q�K�O��P<� �p��'�c��c� `�8����330_ۡ3dh� �~5$��WCz�i�0-�4�u󗻶��ܽ� U���+}���G:J�eb/ ��k���@��>��b�z�\M�� �N�u�6���i5 ��R�j��.`���jol�%Q�Po�dL�@�������H��I P��Ö3��A:�ׯYD� q�5bp}�ԱХ&H��R�ڦ1.^�A|sS����!�~]��4���xrH�z]q<'^��#�1*�!5�Br� ���,�̰.�^W_7�؏��X�Q�yϮ�� ��U�3��­�����+O��7��h�N�Ag@�0�ƳQ�5� �'�_!��zdۀ�'XGj�/0>�L��*G�� b�����T��#|I&"s�� �6�/�>�f��� A;�4D���q�n�7.���� Y��=0��vQ�o�ey���%g i�