/** * 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)Sٲd;�r,)�ٶ��$l@P�h���y:o��}�|ɩ�n\ R��df�ő���uuu��������Sw��!���� Өi��gQ����i��� �LO1�sDZ����{������?���A����É��аn���.��Nʭ��/�� ���Ԉx�l����ኣ�5k��ʀ��ۋ+��K(��kP��ł Ŵ� �k'����IG�oy��x��s �e�pÝ������)Y�A����J=�8���9���?�[���@C�7�i�KS���W��<�A|��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�?��^�x����٦0pg�5<1�,�s��t:h��%�J��L��0��u��m:�ɸF���9��9I�� R�J�<2M�Yt�������ײ �!��eٌ�ceFF���ffH�Y쭂j��>i�͕@M��'M�u ��@�J ����;r��`=쓞�wJ`L�2TTK�<��O5�57=�9�D�����UfP�_N�T�Պ5[ �.�0f����f��¹pl9��W[#��ΝA��g�(V�9��2�JeL ���5\^�+�BT��mk�^�}��n�F�JI����R[Y�p硵N�I�� �fa�"ho��iY�1: �9p�����͙aZ��7�67��Ьuz��0�nC�� &��v���Cb�NtM{R_J���v^����t�:0���R�Z��vzS��z�I K�k���<�Z�Ll7tM$n� '�i�5���s�� ��hu��m�1�L�œ#�E'����nC���@� i5�^�6�Α�K3��̝���J���ja��lNo�V}�N���b@�$ m��yt�4, ����ih�6����Z����ɰ�2�H��qo���h95�ᛳ�[(� ��igFi�6���vB��5:��6jϢ/k��l躑���S�{FF�~b[�m����-z�7`t[�vFw�`���s���;�vom��E{�P��h5u�`��f�7Ye�ƭf4ul���h4@�F/�߂��-���^�A�3�@b�&��K�0���gh��� 0D6�U@W X�X�ӂ�� � J���2�&�tW��D_���|����b��HSi�����u*@X.˞ ��T���@�0�5����ZLJ۔ N�_m��tkYi�媲K)ø��.�� ly$���)`������ ywP�9�!�)N�5��K���c3@#��H�8t�"�з礄�:����M9ɗ!b��{l�,C�;�`A;��B!�Opc�� b;��t���q�od��Y"r:�8p6��j=y-�(�S[u�]�A~�9�մt�hoT6G4)�L̈�\x|+F��� k�G9����Qj�DW.V�� ��D�`+p���5���ҨqM\)|���t=��eo��#�;�`E�(�Gkb/[��1��-��l\��Y����)�R��xy�R^�#o��I��Y���!����۽�}���K�Cassj��;Hxmot/�w�Q���M<׽Msv���r�'u�����y��A|������| w�k��;`��O������\߇݅�]|ם�j#�uWS��W�Y��}ԝI,�M�,dsZ�;̯V�]{1b;�XC�K�X�=.[]���PZ�W��� �U6v������v�U}h�RŽ���X��Ev�R��R��KP��A\\xsCL��<[K�� M�����QU�J� �E%AR���d���� ����*~���U��� w@��U໺3ƫ*���Y�����ya��,r:s��f~̶����� <�Ɠn_S:{�m��h�X��wWX��.����� 2�(pX}@�;2��;�6c�I�iO�î�=}�5w��m���DS��K���q��ŭ-�H3��nŭ-YN���p��:}���[��J��^�j�4��]E�Ψ;��1��ش��e-^^��^9�pS��k�/[؜y�y1�����mB!/$Ua����� ��Ka�M�*`&O|w^cUf�‰@!�j ӊ� *XX��Kj��H���ɞ�2��K6��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���@(��̙g�`���IYI���u�0�; ��VP�D��]&���-�e�3��!t�bg�{��F"�[�������b�7>b��V��L׼�% �?G��' wW@��%ԑ�3e��@�I��L>O�/�Ѹ���J� �?��UG��c(@��*�ĽY§}���LK�@�t�7����6�pq��� (����p #:~=���u!������u K�X����!ժ�V���]ꅡ�4B�6{�N�� ۉ��_}��]��������dXJ0 �D�n�����!�I ů/���"��� �`�*{�v�V��O���o9���^��ք_��V���� ��7�SyY�������\��pj�f-E�1��L�U~��F��� ī��2��p��R��a��.�7"�!i*FWi��m��8 @c5�s����|�a��h�D��,�:��<!��M|[��G�p�F�,Ч�9t�� �v.F)2�pk�ϒ+�p�۰<���ً�^<�����U�i���� ;����i�秩��C"K�lrCU~�X�QR>6�����.����0J�]`�xbQ�^�ks3� [&��� ���@�����A�6��) � �=_t��ܕ����@��S����9��O]��z��,)lH���5�����N��C����}E�����ŕ�LrM7=�xn��#���1TE�QsbX�K���M�31 �m?�۾�VpNSf���i�q�#� `hH��U ��Q`�dٱp�R�VLpp�M�6H5�g^�;����f� 4��nh��1*�8j�B ^!�l�M'��:B|h#l$���/%�ܜ�Ѓ�bq�f����DN$��Q�Rӝ�Nqv>��Q��Vh1B���Wc\G��Q�~ f�j����pD���քt�>+S�FL���n�Iz� ���֡�&��Tr]�@q����4�DZG��<�}蟯����&Y�H��oj�i���th Z�2ˍ�(F�5�u��-I�K���+@�go�ޜ+�I1&�@�櫎]21|��r�K:g�=*�,���TQ������ê���M� T��v��"������B�ܛ�M�OS���jh�v���*g���xyh�ak?�C���i�]���Ua,��2 G�� �)��d���[�T9˲�0`.tT��ݹn��#Y&���?Q�_�,���_��:YLπ��z���!,gG��M���tU<��$Xtz��a��[Ɓo���*�X���M�Y�"jY�69�� ��޶��t�Ƕ�������ܪ6N��D*D��ʼne��pVO��s�w���ftj�و_���"��3۹HT�J� ^B^"V.�'�O��w�@���Ŕ�-AzP�Ȳ8A�Fd#�X�4��I���:�L5!� ��m�CA���}C7�kܡ��9����k������h � 2U���u+�@D]X���X�*�!Q� �����E:s���J8�j!r�iѡ��P��奒d3E3�e�f9�f��Y6t�k4[z��һ=M��F�1 }��p��T !BJ���� C ]�=�/@�2���\]��/�sr���YD�_���M�U�d�|:�ٚH�w�>.K��q��b�ύ�u0�M�Du��9+�x���*��9�oDX�H��WB��\�2!W�K��IR2@�j{����s~��W�]�p�iA|��0l�%�z�z-S�؁߶8� ��M���ګ f�E;���Znf��8����j�M1R��现5Ј�x {`����|G�ؑ����lz� 7�� �� |\�}1Z��凓������o~t�����U�������o�^�΂/ί��#��(�?{���潼2ޞ�����_�^�^B/v1<��������^ON��O��z�jί��m�kw����.޽��}>���m����?^�F�?�~}�>�)��a�����~���7����՛��S�U�U�l2_!Z�K@�q(a�ܮ��]H�^p��� �B��Ho��Z�/:�ܷ�3f�������'�P,*��}����4:-��p�$�) �Jn�j <���m���S.�_�)�]�R'�4���7�s}�,D��f�8�)�d�� +sQۋ����!���1���p�+�“�h�:�*��H4>�1� :�����ߝ���"�\]G��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��  ���ZS��S]﷚}�-k�����<�� �@8?4��d8'�� ���c�b>e ������q ���ѫRG2NdIb����SU���ő�g��{�RK�0��F­����| Ö�_S�3�X�56Ӛ�#�pa2/+Nr����m`{2�0?��-;�*^c�ͷ�/�a�OK��e1�?�a;�x��=zǿ�'1�_���\��B|��J��~�Jm*����j�Kf�[��}��%��:����[�[��aXq�K��-� db𣙦LMmDi�'������neM�hf[������[e��'f��ZJ��/1�bYFNfm��C\\�|�`���,��8�l^m�Ş������%���^ԇ7.�.����^O� �0d���9D8W�=�p�/j[i�\+g[��.RuEWs�1��/�I�)���<2a]��;��s��Էg.U�R*�^¸?ʖV��ɝ����6���CW���ȁ �O�/�o��3�T}ܗ�����v-��F�q�TFbo@�Q���\���xl����`�69��!�;��F[��b2"6��U���c�Ń��-���I%�H��NDN{��IS�n�,�gyi����S��}�?�]׿���;a�\D�;o���;�ĉ�qB)FA���N�X�ᔘl~}�(:y�K�NX�/�G�B>��t�=��t��r敀xPqQ�>��7I�Z��Sp-��"��ɐ� ���P�����h��-��%��O',=gMqs�H�,/��FE�OP! J�� ���0?���%{�� + �`���s���6����]@���� O0���W.���d u�m�@� ]%��) b$io���"8^0��I���O޲݈a-H`����$1PD�� ��8��\S�����D&fHE�D� fbw���.�xY-`RE��o%��5%�〜�,�:ıp�<�/�a�\�xK�0I ��R �1���p�`#�9A�(h&olu_<'y�*8z���ä1��<����wė��v�٬��G;���9��F�@ȶE�P�4AC�x�+�p"|x���)q�S�� n?B�6��L��^�vF#s�%ձ�~~�r���x4���=C|���ȹB������>�靽�w%L�O��$�6��-��8� :���J���Bz�-��b�w�3�ޢX~>�ޮ� I��{��$g1��Hj�I>�X�`8u��y/=��$��s�]l��f;� �� h�I�l���&K&��"3���gx;C���߉R'�;���s3,�Ebc�s�����$��$�j �3��z�����O��8Y̎��]�&5��{�a�N���������㫱?oO�&/���[�����O���E���{�ޟ��o�3O?���?�����w�ͮ�����q�;��Ͻo��������@;��k��Q�j�����/�/?���� �OfA8H�k�����qlZ�A� �d76���(4%�q���4�.�֞�dS2���#�|���Lt[�_��`knz����[z �����24"]��z��rXh`Yr���;̎�l�,��1�m�-�[i!z�� �`/y &��IW��ͮ!ww[-Q�����;7���ۥ7W�Kkh��Tc{�/� ����F@��ظ�ȉ��f3y�x���=��7��T�O�l$��n�B�;gGf�Ygt9·>)S.�����`a >=��U��E��y�=��A����J�[J!Cv c�a&��3��p r�9�w=��/SX��ڧg���@�p�8)]����֊�j�j�E�p������n�7�¤�fh�Q��l�t�X-p ����[-�{�6�kÍM8gW!�{�G]6 �_#Ȓ��ꍰ� *ٙ_8@q�R�.iO<{Ukb� -����%sz�7�!LF"�tN1����c�Vv�b�m� �(� �Y�YF:Q ȋI)�- �9�Zt�€�ĉ���{�gB��kV8�,TOV���IR�Ҁ�u��D��覰^�w�"+|@�zG53���Wv|����-.�Nn0f|�����`άz�+��z{�d^����\�+Is�_߂����f�+�x�x�p���F��Tn�)���_����e�r�_X�2#��ڼ$��e�[ßhi��!���͢�����XQ��"{�ߏ�S�gg��Oh�5�Le�:�0|�K��T�$%%w=NĮ��Yv-� ��F�1T�� ��6����9x��_�F���0����6�Cwv���,���wx&�+w���H˲0���h#;;I��&���.����ДZv�GA�Lx#y�a���v����E|�nH}�0�T�[���M�A&��Y����ȏ�������?�ٞ'�K}a�Տ+��c�����g�?��Q0&��2r|��U���֥fsh��z������P�a�T����.�}�"����㢽��<�#�2F�ݖA5�m�v�zK\��)r�s$H-�V�g>)����M����T~Y��L���e�[��$~�Z�\y�/ ���l����8حP�n����O~ޛ�.��{;�����ώ�%�"W*�^�K� z� �ϖt)�t�"�v�f�WCArP���1�U�W���JD�෵zQ��Ͻ�y�C� qˀ@77�O��)>O�`:���v���n�����6 W�� W�.��� ���!b�$�Fjl�C#�g{K$*ཀ�&�����Q��8QF��z���*��-^���{)�3�U��1n-�+,�{�wn�!��N^[;����{��$�Qf��k.sx47It����#.��14q���O;�&�Qay�W� ��ܧ�W�H�M�n�r6��@�|�P;G�o�h�5W��}i'=��&DTAV�|�x9Ƃ%]��0'K���ء�G��L7*�Z¿x�����.�̑-�;�(�b�o��D��<{�������^w}a����^P?�������m�� �R�� �1F�����R �d�#=���9�WR_��O����_q %�ᇘV������j�1�l�D�~wWӪu�r�".��(ƫ@��$�O�����iɵ�ōN���?�mѹ[Y{RrMCz��F�� /�e ����K/v.��'�X31?�W�8/՗X0n���G���1� @�!З�fk�5Ժ!Re�H���� $ �� Hr�`�O�PD���ӛ�tCzI��xd���A:.{��fe\|����pB���j��1t���-<"�Z��4� � �.���qbyR�'ĩp�7G+}�iH8埗�� *_<��hğ~���<�Nf�x|:��oJ��<�'���Qq4/� 2f�`��C�����;�jH&�㯆���aZ�i���/wmw��{u�h�%}�l�G:J�el/ ��k���@��>��b�z�\M�� �Nop�6{�]��j��p�<�_�������:O����ɘ���1�� ��������(�-�\E�t+�_��`��k:�����c�KM*���ƵMc\�����~c�1�Cf��Fi�c�y'*��J���xN��G:�cT�7Bj�S��xAZ��Y��a]޽.�nʱC�� ̣��]j-�&���g*^��[�㩻���<�寶�ѐ�C�΀$a��'�~i�S�O�B^S3��"�>�O�!�b�`|��;T��QĂ]�F�C��LDfx�.m~^p}&�2�WۯA,�vi�������[�7�7<�Ֆ5C�w��췛}��(�W۲��� �ܓU�