/** * 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�� /[d�xISٲd;�r,)�ٶ��$l@P�h���y:o��}�|ɩ�n\ R��df��!���uuu���������DS�`�~�p�������i԰���0Z8����k����zj�ʄ��I�����gu��̱�/d��@�D���uϡ�;��0� lí�޴>��s#�Fuߙ�m7��J�E����9�u6��H�� �tk�C��@ ���#�qJ#��#i4���^*����1��Ҧs� "��in[�d`�Kۤ {���ڑ �C�p�@�h";�Ng�e,�/^Nl��+��u��7��y~��^� �(�K��M�+Şc�����cc��vR����!�� �1�<�؟d�S�O�1�J�n*�v�tg� ��HCUU��h-��T�a�Pg�g�!22��9��5�W��cX{�*ͷC�%�aZR2�A׈�D���5|߱M#�=���7WS�P%�+����'�2�O�&���������듗�Z��3��W0v�M�P����_��*��� ��7�*`i�C�[�s�JW�u2K�3 �sA�AIq*�� �E�*�6.��Կ&�}8:><;�@����m��测�O��g��F��C2 ����y�H=�����zX�׼`���Zj��1���Ǻ֪����zG����,P��cx /�w�6�~���{P�T�]K���8X�������vMgf!��!K`�% � g��% �Z��K77}P�#r6�C2�J�]�2�. � ��h4sM4Պ-���K# �ʴ��B��Q�`y��:���{�h�=*G����߫�tN�q�vi83z2�To�! C@sy��^�{���?���������hQ���Ћ9Ar77 y�4�5Z3A��=5��*�2�.�K�{��weUH��3��J�j��@.���6�� 0ZOX���� ��U9T����x���j?��,pIT�`�JR����Ȥ�� �}��� �� �6��M�(i�c�' "����o��95>�FT}��j�g���i%�0V����{�Gk���sC*fq$��ӧ���5�s�T��lw2�z湕y���$̈́|���/���R��x�t�Ϫ@8 ^I-�ۉ���P*��������>�kE0��Qӑ�B��h��a���oh8���ӧOC� ��� ߢ=��F��)u���V ��!����$��x�P��*�d�*� �#,h�nI����{Y_���;��#��*{��QC��$諰��|I6j� �������!xP�$����p4�>����iU ��F�@����X�^tU�~T s ���?Re���v b�ZG۱�aݔ��]�M��[� ��_d;�S�kCIx���U|�ݚp������he@Er���ʤ~� ��dʼ���S�]3,��%���#�!*��ɛ#�xx�\C�EY5�p組,��rIJ�}���>F��B�0�{�e��"y���V�A�'А�ΦCd�jI��+��e �i��}U4K�k�N���J65�9�>q�87��#hH���VDK� �����O�CX� �%�A?��XM�-�^�E��+�7�Z䝲.�R�F���^8�ʳ ��g^>�>{�[ ��PI�r$Y�$_#��P��7rUTJd�U�[=h�n� b�O��g[��=w�edmج�*:gtE@Ā��5S�:���L�!��ٵhB�\�_Qam|�մ�A:��i���� JS�>͕�ys~F��[V"m�����j���e �Q��z����o>�34�/ٶ�To�Ԛ�"%Y�h˙��J�(�k��$,���p�Lp�m��Y�^�њ;<} na.+'��R�*X��T��C�`` #uf������J�=b[�=o�H���ʘR� �x �ݬ +ֳ(�dA P��A������k��ԔZ�1����V�1��18�0���3X�r�����IP$��Xc!|e����Ύe��c,z�#!��)V��F}�z�E����r֕N Pwi���"�rX�\�15�����JԚ�Y�EE8�U ���֖q����o)W>����\��n2��(@�C�3�(�= �`��I�cE��:�>�� ��!cll̸�q���,7�M,d��h-}8�"Ͻ�@-]����ǣѨ�*^� ��i�}nBJ`X�,�u�Ͽ�g�k���(��;���qeA���Z��&� ��JX�Vk4IZCL>7��4�E�7)�(����:c#1�A�XɚG��1��7Rq/��ZQ�!������}���(J���(4��:����f����4{�Qo��#��HGr�-䴶�����Z�.�H��� `L� TTK�3�u�-�Swi_ږP�+�͑NuZ�̠�z�P+rǜ�vw�X�2��X��.��t!*� �w��9l��>Tu�h#Y���F������u���j�۠+�C���w�;li�(����K��Ky�� )Q�-���`<4*mYkvd]��Z��O0���Z���*�T�Iu%领S�Y5��_�t��{_Mȫ����ZC��z�I +�k���<�d5U&�dM�[��I��`Mb=� )�]���6���8F�IU $���T��ؗ��� ������u[��7=�A�s#�*̝��Z��&�jb�glN�5��[%zVX1��f��6��<�q�u���$ 4��έ�5����no2��t� �3��8Go5ZN�u����J ���[�Q@Z����-�r[��F�Y�e��驈�.:������'����F��JϤ�xF��h�t�u�t-C� .k�ֆI�G� ) �SWuf1��iZ�U���jFS�ry8��� Zջ �&4x l�����x ��)�C4 4\ �!/6>]]��{!�i������X�&D���0L�5���i0�vg H@�5�-̯��@�B���@:Ҩ5�׀�H���K@X�(���T���@�0��D����Z�K[�� N�ZR���4|~J���J�0�F���ŕF�[I?����ih�(� ��q%oz� h�f�`\ `J9��z=6|4������� =kA X��Q:��o�����Ă�}6BV ���[0���`�9 � �k�X�e�:|/s�<��[&�F�� � �Mݰ\OzVKk�d�V^gW�x�h9-����*�!��M���\x|+F���*�G9����Q j6DW,V�� �6D�`Kp$�� �$�%���qC\ | ���t3��eo��#�;�`E�(Gb/[��1����t\��Y$�V�-�B��xy�R^�#o��I��Y���!����۽�}�o�K�Ca{sj��;Hxcot/�w�Q���m<׽Msv�6�r�'u�����y��A|��o���|w���;`��O�������܇݅�]|ם�j+�uWS��W�Y��}ԝI��M�,�sZ�;̮���x1b;,YC�K�ش=�Z]���P��We���e6v������v�e}h�RŽ�(�X�Ev�J��R�ЋQ��A\\xsCL��<[K��M �������Q�Њ� �E%FR������������2~���e��� w@�ʕ໺3ƫ2���Y�˄��ya��,s:s��f^Ķ�&��� <�Ɠl_����m��pb���wWX��.��V�Ǐ2��qX~�;2����6"�I㰩�O����>}�6��wضh|��)X�ܶ���2nۻ��S3҈B�[qgGQb4< �ƱN�c`��M� \���E �c 7yn����͙ ��c;����&D�BR�0 ŌF#c�vY*�.��#f���5yq�;{d�v� �G r�܎&�l���ĥd�3�Jl�_י��LV�/r7�ٰ�W�a}��MA�|&% �:�[X��|[�8� ��P��O��������E!����s�u +.Tᷦ�!ղ�U�������^�i������/,;:�}�u.V�:����[Ї��o����- Zw� ��E*(~u���x��^��[gO��g���8�������x� |�]|n�G�m/�����:��� �� �l�� �F4`�����X�� 4��q�xk�Q��C�C�;Y��}["���̅[�/ ��ީ��dDqk/��5��h��s#�ț^ ��/l��I(���H3 /�R/��ij�r� G&<�`�=u��C-��ۅ�(�J�><�/��An�r�ӇQ���h�x#M��~Ӭ�\/�@v| ��$�KR��C"K�i2�S~�X��Q>���� �"�.��$J�Z`�xJQ�^�kc;� [*��� �7�@��n��A�1��) �� �]Ot���k1�x�Qçd�tsz�_}%��%��$��!gG7(��S:����G��A��.��-e�k����1ų�z�df��PJ],G͉a���H��6����k����{�[�yL�@^f"���ɍ/}�SVT:G�E�n^�¹���0����xl�V&��q���F� ��*������x(�㨁� �x ���U6���j 񡍰�����4s2r+E��J��� �PA)1�&��2��#��|b �����,b�~xY�Ǹ�`�-��̌�tNs�� q�M �d}Z���\˦ݰ���cǫ��C �J6��亄��q��oaF�cgCe�y�?_靈{ <���"����6��)�@��U�QQ�`kJ��X��� W�*���]9 V,�`�>���W;d��� � �t�Fx:T ��X,8œ��1�$S�ei����|�P�"� E]��:���4�+C�П��'L��P�'���u�n'� ��p��^܇��s�»0�Yc+�X� E:�;nA0�Sr��Nޙ!��?(s�i Xa�\谔=�3�гG�B?&o�~Z?y�O�r�I���b��|�&�r�쳺��_$oQ �88M��&�N^�ݐ�B�AOE� ��L��J�f��2�u�9���/�[%�"B���%���Vvt)���Ie$E%@?,ҙ�f�V©�D ��� �=�K����y-�f�fb+L�JV� W��kjGo4�n��u�j]�۶/�$�p�Þ��� qb6 )t��p��8��Wsu-�����f!%W|��x�-�����c� !�o��( �)���7>��D'6���{� �X��.��˕f��/�#�DR���E��� �_��0O���W�;�-����}�*�"�#U�⫴�a˝,!�����m�����A_��n��D�^N0�.ع����r#%����n�]x6�H��`T�;��@C�뾱`�P�]e2�E���u&u�M���}��0ӗ�t �]a������w@j �R��,���)��Jc�[g�b"<97�������D���CΠӋlwS�����o�'$�E�M��o�T\ķ���0F���5�3ߨ";[��� (��u�Il,�{V<���SQ|�����Gƕ�z�Ų�x7�� �9�q+�c�QD4�c�%�M� �#�X�Mj�����m)q~�ʆ��b�/�v��f������e��:�������z5�>.����������}��?��e�ː#Vf����RDD����"� ����P“Y@���].6��F�A��m�0q~��&X8�%6 Z�q�||$U�k�� ]�����aFz�aÊ�c��J��!^_��]��)���^/����� ��S��'s:d� R�� ��c�8���V#� l\��O�<� E�`n#X� ���w�B�̢���n˚61����b�ro�ڎ7j�T,Wo:ŭ�)ʳ����$WS� {�Ɖ ��k�Z�ۭ���t �pQÕ↏%�7��ZfR҇F��Yf],�u���3�Q`�_�oGĥ��~�ALR�m��+ D�>���C�I�:۲��?N�+�� �����]�كv�F��F�zX��V�vh .���;����2َ����\q�"��s��e�r�Y� ���MC����s�ڻ�8;�Eϐ �#c�fF��U�,���`��, |cלF@�3+��F�4��$q�|������� �>���z#]���?��(y4�/�Jۦ�'� �ȮU�i�[(�sT�4��)1�L��G���Ўo&�[;y�($�@�~I[<��. ��0'ce1� U&�2���v�d����>T`1$�Cb�2"�y�qU+����l��M��>���O',=�X����/�RZ^:�: /ė_" J� g�1��H9��!{�� + �`���\3���N����@���7�'O�+��c�Xۭ��Y� ����Cg91ⴷ��o,������|���-��'�[_ ,���jNE��8���E�Ȇ{�A��21Cʋ$�^0��H���H�p���z�4 z�P����rq� h7���yY�/t���2y0_H��,��a��Xe���c|�����F�)s�"QЌ���x����Up��Gqc�'���Y|�ʞ��g�� 6q������c^~�l {� ���"M�P9.�� .���$qJ\�p�E�����K�Ry�Џ޲ڝN���W� �ٽ����S��Wf������}�`��<}�����w�L^L��8�6��-#�8�5 ��^h�J.���c�] D����Ÿ)˫��[�"���F�g��H�I�ĿLX�`8�a8>��CUq4L!��&�o� 2pF���Igy���x�F�Ӓ�V���3�}i���(uʱl� K<7��v6x��?��_��#6gd`��Ⱨ�x��T�#>�oe�%���T��q�ݔퟟ����?�{�����|��||x����?���߇/:���ٓ����ysx��q����������lt�W �͏��y7z�~3>����'���p|�\��Vk�x�z|�a<�}2 © n��~�C�E�9�$��Y_Ɵ�A6���Wn�K���f[�I���z��.���Yl�g�۔Jf6ۼ5�G:���9��N�hDZ��?��)A�������0==�e� /�xtR~�8��'�ʦ�)��d�*��ХM�Ͻ+���GR��4��4^6��?]Ww7�?�<������Y�͎�_�]��3��O��t�+���a��Q'M~@�t7N-�;!P�Dk��φ�A�[QEF�nT�������o�•�hm��ѕ�~�)������������Z47�&�J9�g��$1�B��;�c�1С�[���М��:&O���'�^�eL�x�"��4��?̜۽8��(����H�r����� ��0Sa[֗6��H������7ݫ�2S�|H!dH�4�0�`�qf2.A�=g�g��e`r˛e[�t�a��-���Ii���l���K{�EN9yá�.\k��B�r���O�{#�&��[� NW�9�`���`{�6rm�7g�J�xO��˂��kY��[����Aś�s{ꩁ��;+��^ך�`L�#��s�:�mf㑈 �Q��aglΡ��G�d�+�$ �C�e���L�bA�h��h��&��0` q"$Ÿ���,��vNa �b�yW;w���d[K8�or�x'����7%�0L��e'� 驑����@� �cƗ�� ����̚�G������� �j����U\8Z���'��0޲��5OȈGG-��� ��or�O�'���T_����������2Y��O�� %�s,=����s��p�'^5��Vo���;� =0�T��4�J�������?[ҕ���Ś��Y��?t���,/��f/c'�فݳ ���L�0��F��ܓ!n�>c@�� �1��%��̷��������S!��t5��M�B�-�+idx�����@��� ���g6 I���X����(1�"�c�⌚��1��@;-c��%yW�O��Q� <�qg9�����xM r��e���(+�|�K������c%�eO��&NvM��7�ދ=]'�H�Gn%f�Ux�2�_�}�{����馟�i������;>ys�#��\�����r=&Rd�'��c�Y�%�3�$M����z���\��b��Cz{[�\W�?�)m~���x�ϡ��K���ɳG���?� ��F@��/��s-�+X��ᒅԓ$Y ����!� �z�,E �e�7�W/ ~�z��|�t�����(�~bJ��!��ԓ� Q6���uy��Z�+��\~�h��^8^�����#+n��o/�Of��/��\$ٕ�S����[�ɘ)�t�*���\�h�؅(vc���l\]��@O�� 0,��c�})�ɂY⫳=Io4��C��� ��x;��{q~ ���eC��(�գI(��%���z� w�������� =e��l��c�3��/��T#<$�1��:e���xLM�� ���A����8�,)N��T8~����>��N�f%�3���g3�_����g�Y _68Ž���e��1�8*��#�eyA���ײ�:|z�Y2�?d����4����/wmw�Vx}*i�%}�+�G:5���Z-� �l��Y���OP잨_�+�'[)e%��v�־�n6r{=�r��6(W�"�"��,�1���6\Ǜw/B��$$ɠ(�-\E�d!�^���q�5`p}�N��Х"�H�Ғ|m�a�i/���ޘF�Q���A��xd� <�R�Z�];ڀ�# �1*�!5�gAr� ���dFż�Y�w�{yJ�E�lL�(nnf�� ��If*�Y���m���9��)�W��h���@g@�0����4��'G��F^S#p�"��Nn !�bע3>�L�'lޛa���֮7� �g�C2û�pU� ��S�1\�A��} R4#HC���7NxS�j��������ꊶO�FO���e��U����?0�