/** * 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\ye*[�l�b[�%%;��р@�� Jb͚8O�m���O�/9Uݍ+A�����Y�8�]]������٣����_߽ �x��o?�?�5��@��|v"a5m��,��.�w�c�5�_OO�Pg<��zpu�L���\��B&! �IQ_U}���� �8i4��4tLO���zȖ��ԋ����/R/�r�Ǧ+[�5�j0��#i��i+@W�IČRd�N#�S�Ě�aD�tv�R�IDM2�L�t�&vb�d��朜X�w�k�$�_���h?S9T��N��8�II�L�+ٙ�c*�2���k�c��d�2%����!r~� �9�}�8����/����:�f�M�NjCРc��'MMӂ+��ٟ��� �����ۋ�������U�H���.p"�+�aVR2]��3c*�x�~� pˌ�S�(��j�B�d � ��h�]���dZ�44��{�%������\�� ����/ڔCK�� Y]m�w��Ќ���jSS#FZR�]FA�e�#H������� 9-� �cz��� 3����٣�G����������r~Щ��9��7�Ȁ\KC3�g�+��Տj�\*~8����}�� �G����mES�ծq�5>�RC��xcx�.�w�6���#�'|��ƩԿ��탹�b�������Y��F��#��0�PW�N�� :JW1���=P�#r:q"2r\J�/:!yL=6j��h�Yh�5��կ/̐���A��tb�h�:�,/\G�}�)��O�3�'s�k�$G���\���j����F�9��Ԧ�������N��*���3���z��bM���MJ>� d�*���V\�Z�M�E�@�ʻ�:$���)Tk-p���@.���6��04�5���'�S��\�b`�j���c<5���^H�Y�X�`�ZZ�����Ȥ�� ���g �% �.T?@[`Q��5�R_D4�Ǚ�kZ�{4j~���6�834͆���S��`�X��Gz�Q�=2s�M��ő��O�>*sւ�Ö��N7�l�۹gZ �-I�J��K)�BJ{!�ގH��X'�� '��`F'��PJYC�U����GI�c��k:r<�_ �#�#�~��+������ӈ�#���{V%ȷh�ǣxqJ�Cf�5�j������ ^�;���-Y�7�A���14ɰ���%���ʾ �o3�w��G�M��j��p�AI�ca��R�T0 HM#M��. �I[4@?|aj�}ԯ��� �� A��b��c�{�U��b% �(T%�~�5�p��هǵ�a�T��]�O��[�!� ^�;��k#� >��V��)�G�k��� �5��W �PUנ�� �8�i�/.@��NcQ����� �5���3��z/ʪ�;�d1ח7HS����0ꯕz�q�3�/sF5�~�* =��$o6�0����询�y������z�hP+�N���J>5�9%>q�75��#hH���VD+�J �����Oᗰ�c�;K��~m���[ �(~� פoFJ쟰.�V�F���^8�7f9�F�{��|��e��$�Q�H�-�q�<�B�l��UQ�����8��C @u�V�X�~/|dž��{S.� o�V�P�9��!(* t�`��*D�Q-j��<[�'�+4 �5����Z�t� �rmP�ݠ2���B�oΏ��t�Jd��c�_�]߻7�G9d$w��x>x��[�����M�K������f�HE3�j����V" �Z�( ���ܼ� ���1<���}����ӧ�.�c ��ZJ Uˀ�y4lߚ��7� E�q�O��1���;3���j� � ��q���?�A$kz_eL�lEQ2��l6���}�J60h*�n��6�HM�혃�)�.`Es��s #�k9�%,���[8�E�)�5� ���8���ڲ�(p�y�p$�3� 6�xr�~hӰO`Ĺ�u%G�]�-泈N��,WeL�p�x}�MѺ ٠�����:c�5e��8���Vr@_�]1�(d�l�3:+��8t}��:�� 盛D2VĺQA��Z@(����i�1�&�a�f��V�hױ�5�J*�pǾw~�Z��|���G��^�xY�6�f�i�q�C�vfQ~�����`-�!7�Ma���kxbRYP�VM�t�$�!>� Kҕf����a��g�tE7�tz�q����sޯs6�0�����yd���z-�Cߏ�e�)Bk˲��ʌ�,G��̐B��[Ւ�}�R�+��r�O�j� ���@�3n!�w�]໣���>�U�N ��^���j��������3'�����cs8�Ye��ĉA�X�X��0��R9cF�n�6��p΅c�!���Ԡ�p� Z�?�D�"o�y��.�T��P�X��Eл� DeZ��ж��U��a����6�WJ�l�Gm}d���:�M��N8t0 Aw�m��e����s� ~��ۜ�%jz�m�q#�Z���� ��6�:ў`bMo�=[u�kړ�R�e g��j\N��ЁvOK�k C�5��v+� �@���*5mxh7�L ��n�H܈N2�k���H =Z�����ۈc��V�9G��N`E%�^C���@g�j����[8G4/�p*3wΦ+ v[@����9��X��ub�5�*h%i�h��ͣ��aa��.��KӀ@���ު>Ph����&ê��: A'ǽ�sD@�V���X�oήn�"�Xz������N� qВ��kۨ=���!b���F&��.:}��(w�O����F��Jߢ�xF��hgt{sO��#����ջ�aR�B=H����5�Y�n䚁�d�����Ա=ί����)�4xl�����x ��)�C4!4\ �!/6>C[�V�!���J�Z�X�D��h0LPZ��N��4H��� ���6�+��0cH@�J��� mE�T��8\�=F�&T����:a\k�O1ʵ���) @��e��ZE�ֲ��7 2�Ue�R�q5Z�],.7��H�K�7R�" }+�A�*��M�rBCZS��kL�#�^կ�f�F�*�q��E��o�I �u:JǷ��r6��/CĂ���Y��w n��vJÅBd��ƈ��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��'ݾ�t���f��ı|/�ﮰ�]��-g�@dQ���"b�vdNw>xm����AKӞ�]M{�Xk���m���DS��K���q��ŭ-�H3��nŭ-YN���p��:}���[�{�p��@�i(���F�Qw��c l�1S�i���Z��H��r,���ׂ_��9�5�bl��;ۄ(B^H��š�f���(;�VU�L���ƪ����B��@�;T��诗�D=�4�;��=�e4�l$�D���@Ee 2�,�.������*���2r��O�R9�G��9��ƴN��K�l��:�)9�~����c����c��OL/�׳�̋g�tՄ����wԽ��]���3 )��4���b��E�f�Sq �'���b˫X���s�s�!���e�`�x<����k�� v�ȱ�xNb�@�K'���K�6翏=JF�5C������솷d��~x���Ϛտ\ �[G� KZ�����ZB��FQM�q�‚�j���p���N��{�IU�ީW1��Gp���Km;߉��RO�*٘�7\po�f�p�E�Ud����Z�_Q6(����#d\�y�|r�Af�Q���k�� � n.�-v���,z[�����P���:D���[�UH��P��� �| �.��M���>�P6�37���8鯓���_#��D`�w�?��,L�\�LA�[�� �g��C�����ؕ�D""��� K!�k�H)n|�bխϙ�yKK��D�O@&0�K�#�g�x���9��s��|��_�qyk�x@{��R�P"�nbU�{��O���(���o`���ml��&�/B Pb?�%$�Ft�z u��B��ϑ��@�\���Q�C�U��`�;л � C�i�Hm��N�� ۉ��_}��]��������dXJ0 �D�n�����!�I ů/���"��� �`�*{�v�V��O���o9���^���ï&��_�������o^������#'����Ԍ�Z�rcl������F��W�_ez��8,���.��%�?�]�%nD�C�T����##��|) �q��j��0J�������������YuF�yB�9P��� ���6��Y�O=s�R�A��\�Rdv��>%�%Wf��ay�;����x"�# ��}Ӫ�=?�AvrU��$�OS덇D�N�䆪�z�ʣ�|l���7'~]1=h%8a��4��'�ռ67���e��+��}- tZ�� 0Tkc��������Eg,�]I�|��d� >�{�˘���ԥh�\������]�HJ�O��<4~xpQ�WY�۸[\Y�$�dq��c��&�=��QOC%Qt�5'�Uκ$�ۄ:�������m�4ey�I�f':���DL_�PUAH�� .�k�D7��$n�TCx�Q�S΁jh�@#�f��B��&�'�%2���tb~N�#ć6�F�{ >x�R���� =�(n�ʏ�N�D2J�51�-U1��g�Sku,m�f#�;��|5�u nu��`f�� �K GT��nMH'�2h�D[>톝���;^m�Pa��O%� ��[�~K�{{4�#߇��z;��k���AX������,�M���e,�ܘ�b[SZG�ޒ4�$�O�Ty��� Q�r�c��dl���%#�W�,X��s6�3�,q�b�)�Hu�I�'�:�J�}\�� B��h�ɮ)��J}ϝ/��ɽ�ф�0=az���=a7Zl�rv[�>H�������>d;��ޅ��[Ʋo(� �q��q �1��}�@��� ��A�C�,K� �BG��aߝ놞=�e��1y����>��~.��������� x��g*j�rv�����/zJWœJ�A���0&�˱e�&�|����y�d��)���o��^!���m+�M���"G���� �_^^*I6S4[fj��j���eC׺F���v[zwWS%���bLB�:��8H��'&��aÐB�m� ��}~�5W�b�K��p�lQr�W$�q�w�"Y4�}�&�]���Ҁ1q�>��s�sLt3QE���h� �t^p.�J���� �r�U��/"W�L��g��y�� ����zl�8i�����Uu1iD_e= [�d ���ǻ�-S�؁߶8� ��M���ګ f�E;���Znf��8����j�M1R��现5Ј�x {`����|G�ؑ����lz� 7�� �� |\�}1Z��凓������o~t�����U�������o�^�f�����yq�������J�^^oO��k���W�W��������׋���g4z=9}�?��뙫9�z����u� ����x����代���/���r4��q����O�����=��{Ǿ����ߏ��\��E�z�f�� ���X�C �v]��B2���� �Hl0z��@z=��}� �5/�1����\e�>�bQ��ǧ����ia�ŀ&��LQ Wr��0�p+�G�Y r�O� ~)�@w�K����+b߬;��e�C@W�%⬦��������Em/ gh�C ��6�����Y��XO΢uD��T4@��h|Rb�tz��+"�;�?���D�(����V�A�E|�{c�]�?s�*�����L���X���h���$��=+�w�bqr"��!x�Ӻ]�ؼ�=:_�� �a>1n${�C�@��1�X"\W��P�@1�[��[�n݆7��)�(F�ba7O�g��n;6[�S��X�������9/��n��*M�%Ce�@���d�&!��"�jLm��>�Y$���DR�pd����d6z�㒤+��Έ�����h�Ǔ�5����K�����$���ŌSw�}�l�C�Et�ۂM�Li�δ@���*ŝ1��  ��Ț.7�S]�7 �'k�����7�¦� �3DS�O�s­�@�/;�i�S�P�;Zq���(��P����*Uq$�T�$�-�k;UeY+Z+y6�@�U��*�$��ll$ܺ��z�1li�55/(1�πXcs��LB�� ��4~~a�V�+�C8ضC��E�ٌ[�zk���4�a[���t���٣w�{y��U��ž.ķ��,� Q��#�5�%�qh$��Q{T�u�%��.�M�>[�kk��^���i�� �� ��qr��)�����)�MK�5��ܱmMn {]y�Y]�ju����0[����6���"�̚60�;(���Ť���9�i��K1s���!���Z���X���m\^{ڣ�����j�zQ޸D�q�d^L���U5C5  �h�ҕ�E�%�+‹�VZ2��ٖ*��T]��x -� �vFRj ���.�pXWi�N<���:��Kմ�ʶ�0%��l��a�׷M�Ƕ�x�3r X�S��}��t� :�D�7>(;9%�ݏ���}\}��cPp�<-��W��+��@s��?X�M���7I�Z��Sp3.�����ɐ� �ʀ����h��-��.�<O',=gMq��H�,/���V�OP! J�� �����B ��T�p;V����-<�T-����廀g�C��zPO�K�q<H�v� @� ]%��L b$io���"8^0��I���O޲]�a?H`����$1PD�. ��8��S��0���D&fHE�D� fbw���.�xY-nRE��o%��5%棉��,�:�1u�<�/�a�\�xK�0I ��R �1���p�`#�9A�(h&ol��xN&ī�����Ơ����j<~�_��9g�W��;8���� �]!�^]B!� ���m��‰��yJ��U N;�'�=��aڔ�3�~�t4�Ψ�L�c ����T��1k�+s{��( ���s�`牥�?}��w�2ߕ0y> Γ�ۼ�����W(��st�g*9�� �:H.6�'C��6�%������p��c�q -rS�ax����K��:@�Sgʞ��CfIHN! �!� '�o�2pV b���f����d�J�U��v#� �73�}a���(u±l� K<7�Җ&6T9矑2� *9�U;��阰!+T���Z�}�pΙ�D��3Lj�����؝V������K��Wc�~ޞ�M^�������Ӄ��������#��?9u�|g��~ �/>9{����>�]�����x�l7~�}3>����?���p|�\��BVk�x�~~�a<�}2 �1:7\���%ČcӚ��qq$���=%'B�)�`�K� ��wañ�d�${��}7����lxg˜����css���K��]܆ؖ����`,�SǗ�B˒�M �av�f�f]��(i�I����ҋ�h�@8��ܿ�~^�$��Γ� ���������&�'�T�@QSV=+���� ;Ls�W��I���wf�1ֽuO��)U�H�)��w�j����lb��WdT�ȅ�q��7����-�@��']�#7�����Z�8 ����wn.���Ko�ė��BS�����#%�;"(�����,1:�q;��Y3��g��q���=��o�ͩ �l�H2uݼ��3w�N0�Ƴ(��r�o}R�\"������2|vpk�b�4J���[��� �-���ȔB��\��LVg.����s~ |~+`���[����v����VpR�,�$�ů �8;DN8yáV.����D�p� �j蛡��Lmj���Ub��)� *_�@��r��Ej�6��Svr��|�e�X�5�,YԮ�O[ݠ� ��s�ĝ��%�g�jMl�/�ő��dJ��&��HD��)&�3vL����d����a����"�2�H� y1� �ŀa4#\�NX0�8��|/�DH�w~[ ����� 1���ɩ*��?�x�4��]R�:�H�nد�2����>���� ���� W4�)�)4�du?K�߾��Կ�����G5�X��s�/����q���ߓ�Q� ���? �d�\F��6���洫u�����5��aw�;�n؝��Pq�w�΋}f��c��f��6��ȶ�Q��2����Q����]Z�"��?G�Ԓ۩x&����x��D+hM��*�ȄI�]vM�1N����Ǖ�%����Y��O�� %�X��%��䧽I�]��3�5��~*���4Z�.��q�����$�w`ߠ!�ْ.e}�.Vd��rŒ��(H*��8�@����v߉h��W/�����3�x��j!n�����4E��"L��Y|w�����׭�Y�"g�F�!�f٥4r<�����|�[�/̐�9B�� ��Z�W���޹���#RC��8�9ƨ���ZC����p��� �;��J��v����>R�+.��0���~q6��PM;f� ��(���4�ZW0*�)��L1Ќb�Qt��b�z�\Mw� �N/��6w�=��j��p�<�_�������:O����ɘ���1�� �� ������(�-�\E�t+�_��`��k:������c�KM*���ƵMc\�����~c�1�Cf��Fi�c�)*��J���xN��G:�cT�7Bj�R��xAZ��Y��a]޽��nʱC�� ̣��ݍ-�&���g*޷�;�㩻�w�<�寶�ѐg�΀$a��ǩ~i�S�O�B^S3��"�>�O�!�b�*`|�«X��yĂ]�F�K��LDfx�.m~^p}&�2�WۯA,�vi������� \�7�7�ϒ��#z������(�W۲����Ҳ3��