/** * 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�IQ9�d;�r,)9>�G E2 (��Ѭ��y����y�O�/��� 7�HIIw��!��]�V�v��r��������/�8�8���E��%����Q�"�a4w�=U����v�1�G㨫�׷� ��wl�+tؗ�Q�]E�j�C;#?��`��6ܪ�M��/��Q7R|g:��P���ȋ G6 sL:P.Ci:�aU�n�2����� l?B'42�96��F}���ܖ�g�Ƅ��+��|/�$"H���mE�E�l���Bl׎l ��C�G�w:u-cN~�pl�����������,���xQ��ۛײ=1FT5 3]�Ft ����a�Sh�AA@cy��TO�<��ier�pP��;۔�Kj����Dk���r� ���:�=� ��!�����=Eư:�T�o�XK�ô�d8P��Q�Ds4k��c�Fd{���w��P%}�+����'�3�O����������W�Z��3pE�+;�&��p[MQ�/du�}�[]���PԶ2����ޖ!�P8�p=�q���ۼPZD�#�Ҹ2O�|K��|::><;�D�Uvg�ky���̧��>�Qd����ɍ40Bz8RW��Y����Y� F��R��P����Ÿ�QU���JK�n��"P��#x �F��6�~���{P�T��H���8X�������vMgj!�ː%0 2��3����f�Uե���� 9�!�%��.GQ����Z}2��&�jɮ��+# ^%��^�N�-�D���E��p��=�avi%�'�dL�nɥ3r ���+Ùғa�|� i��� @mU��?��%����ɻj��nd票\���c$w{���K@Y�UD >P3*��� �R��>y�]Y@j� ���Z�q��sp�5�0�y�VG��)�nl��j`��K��eɣ��F�&-fq$����O9��砮§�le���s#�L��[ �����})���B����=V�I�:�Hj!��L�?�RA�@d�o-��a\��(����m��'}���;��4x�x�95=�>Rga�w�,���d8/N�{� �1L�r׮B28���N�$qK�����a��C�-�r3���B�W�} �μ�D�-W�~ɨ"� P�U�}x�T1����������!xP�&����p4�>�7�'���� � �TO�sDZĽ�ʽ�fZ%�~�V�*�U��k�mǂ�u[����7�CPnɃ0����N�� �J���[dEXŗ�[�8�߰6�� ������6������ e�OP̩����� �zc��%����y�@�<�~n����n��ZBq}��$%�>h�y}���B�0�{�e��$y�Kp�R?�hHr�� 2iդ���?���j����f u5۩�[ɦf:��'N�Ę} y^ي�hA�BC):����s��w�xg�E�/�-�SuK�FoAѠ��ݰy���-��� ��B/�+� L�ϼ|�^z�[ ��PI�r$Y�T�A�K��-6o�(�R ʕlu���y+��?m�W�mA��� ����a������A�[��L"�V���]����5 �%����ZNt�} �6XM]�0���\� o�O��t�J���c�����{0�'d$w��x���[��G�� �k��g��%���HA3�b�����Q��EIXh�����f���# ���r�V����sp 3�XB8񆖒@��2�_��G�3���˕C�2F��˗ �a���?;��c��pLi�Gl���M#���ݓA*�a�ᷛua�C%��OT%Ԫ�n��6�HM�e�=�)�`Es��s #�k9� Xvwwp> ��k�+_Yqr���c١��.�H�{�l�Qr^`ѠK`���u-�c�]�-歈F' 9,X.ʘ��v�D%jUm-e��"�ʆc�LV��8��F����+�R슁F.�v7��Yc�ā�_e�F0��$�"֍���Ba8d�M���1�1B���F���l0�&��Q����s���t8�R��"���Z5��MH ˞����׽��`-��٢0pg�3<1�,�s�Tm6�$�#>� KҪ�Z-I�a���洪�7��6�%����dl$f2#H+Y�H5=b��F*����20��0֖e#����Y��f�[U�k]RWjk�jr�KjJ� ���@:��� �5���T:k�:�%Ek.�1��PQP-]�Te�0��ppj�cy��zj ms�A>���k��7*�`��j[F��ʾ�-9��W��C��ΙB����(V�8��*��Jcs��zW���L+�X栱��8 P����d�+�oSK��pg��f�FW� ����� hg��袌#t�s.��/�`�3��DI�5,:���QjV�z��뭊V&�3L,i�F��Ab�L4U}V^IzQ�)��W�/i�t`��V�jEW����I��$���N zC5U&6*�*�b��L����z�RB�ڪԛ��.�e&Uȃ�XS z�]��6��B��Ӹ���yҜ�Df�,�N�lՁV+>csZEӱ�;e�g5�*��i�h��ͣ�aa�^�o'i@�ޮ��T� ���ww�aU��M����^�9" x��rj��7��wP@,��H��� �W&��8hI�4��mԚ�_7�V�4=��A��u��r�D[�]����Lz�7`t�vJ��3��k�X�MpY�;&u�!ԃ�0\O]ՙ�hz�h5Vٚ~�Ml����:Ъ�I�ס�k`K����k�L �����J y����:(�� �Ms�u Vח�B�0!��G�aB�^�dH��4[k@����o`~��� zU_��Z��^��FUm��8\�]F�T����:a\��/�b\ڢ�Ipr�}4Ԃ��U��;�S�EeWR�q5Z��/.�b��H���+ `������ ywP�;Ӏ��v�5��C��7#�G#��H�(��<����d�M2JǷ��b6~ȳ��g���e~'�Lh�4X*Dn���B,��|� ��9@S�-� V#�EN�bN'nX�'=��5E2j+.���2� 1��� "��n%�x���Ũ�� ..<��!�U~��%<�L���F~��At� h���#)��� ҉��t H����"~��=�E��� �@��໾7��"���Y�˄��ya��,s:u�ߧ^Ķ�&��� <�Ɠl_�6{�m��pl��>tWX��>��V�Ǐ2��qX|�?4&�3�1"�Y���������>��ڽ{l[4����rf[#�bw�]�٩iD!ۭ��#�1N�X�K���A��+���*HB)�U4l[�V�1���JŦ�.k��"�ʱ��<�� ~���ԅ�ȋ��o�l�y!�C�;h��΄Q6U���?��y�u��+;�X� 3���`a�_���r,i�w4#{f�h.� Hڱ�s#���d�i"���l��%&�U���Rr��ςR9���*����0O��+����S:�(9�q�?�Ic�N��#��O 7����ԍ��tՀ����Թ��]���S )!��!4�ao�B�B�����ʓ�~D��U,��}��F�B��T�?\< F�X��-yy �;{h�v4'�G r�̎��l����ĥd�S�Jl��*�nxK&+����lX��հ�ut����u�xT�%��pi�4 w,,��J�� ����,Wp�2)�Ԛ�"��ׂ�.6�x�mg;1��Г�lL�.�7c3c�[�� �*2�wgg��/���g��~�2��m>���3�(�Ы� � n.�=����,z[�����@�W�:D����� $[^�\�>�1_i�z�Z�^�<�PS'J��8鯓���_#�c��`���?��,L �LA=X��FS�� t#{��jF"�[��#�����b$�>b��V��L7��% �/C��c��+�Li�H�2�j _��A�ӟ���#4�A�|&%@�t�����|[�8� ��P�,���s #:~=���E!��e��:���[S�j��*X��f�r�+8�*u��/�i������s�r׹|8=ނ>� |����Ѻ{d8v��d@-RB�˫��Σu5�� ��ž��N���q�3��[�2��R�ц���^ csQ���M")k����ي�L���,$/1Ɠ� ���h��q�x��Hχ��B��Υ��D��� ��-^@jU�Um�Ȑ��^ �k ��@ �Ff�7��_��9�P����f^��^��g�P�hN��`���5�*�.��DfWj��a?� =��ʅOF�n�u��� e4���]��u����5d�J�\/I-WY2M��� � ��������Xl@��p�}�$Q2���S��z^k� �X�R�7]Ⱦ��uuc菪���=L�uo��z��^��|�+d��$��1���)+��,1��%��(8;�A��0��ɸvh�<��>"���vq�xu)�ܐ�MFO)���{$3��8�B��b9jN ��uF2Էu&f^[�g����*�c� �2!�Nn�x� ���Z@�sT>X!��u,�����*8���&n+��5�䐂��(pT�_B 70�z��?!/��q�ʦ��@M!>�6z`����/$M��ܲC��8d�R~�vB;�QJ����m����P�8#�Xði�k4���^��1n"���/3c5��\l8�BvSB2Y��)@#&ײi����i����h�Ї¨���x*�)` ?E\g��0�DZ�Ӂ<�<�ov�ٽSQ�"����6��)�@��U�QQ�`kJ��X��� W�Z��Żrl�L�1F�T2_il���[� X�� 6�ӡ,v�b�)�<u���g�:,J�<\��@ ��X$��Ȣ+�\g�ԟ�we�z �S�����]����b�����d� �8ư��!���. �؊0.��E:�;nA0�r��Nޙ!��?(r�i Xa�\谐=�3���Y&O��w?UN^�,dO^��>]NO�w��WP���cS�� ~�S��J�,:=��l���m�8؍��X���r?+RD- �&ǽB\�[f0� Byl[�U���T�[��i<�H�HS�ڑ��*��I3�e�=�N=؄&�� 6���PD:ط�XU!?��.٥��be�y��t��� �a�OI���9�,�m�@0b�Hc�tpǽ������Hޢ<�qp�2�M>�5��1��!9�������0z��#�ꭦ�p+ s^�_ \�r& D�Ѕ�K����R)��H�J�~X�3��<��S=�B[&x����f�j���Ė��嬚e�fY�Ԗ^�k�V]kuTE�۶�F$�p�Þ��� qb6 (t��`��8��Wsu-�����Ӑ�k� ��[�����d�u��}�( �)ë�7>��D'6E�=N�f�@L���r}��/�#�DR���E䂖 �_��0O���7�;O-��^�}�)�"CU�⛴�a˝,!����ө���6�A_��nI����`�]$�s+��I�ZJ������7��l����hq�[ i�W��Ɯ]C�w�ly`�ʯ�kz�p�z�������o�W����~:=����kK���gg��8� O_�~��_�������q{��?�~r��������e��ת��Zw��X�?������u�W��W?�M�i�f|�ַ~��㹣�ݳQ�z_?i���\����b���F���g??������ �����m��F?��~;�?g P�\�&�"�5�����zѺs�� �C��`&��:���z����S�}g\�#����Ž |" Ţ� �8�OIKc��Ҹ��L2���@��F[�a��V��l�@��2�"Nه�:�:�&�Wľ]w��˦:�Ї�0M�YM�� 5Y���]NW���m%�1�-��pS�������l?�h�n+��t:ĐS��"��TD~;����� Qti��ƣ������ �(4ظ&��Ud�q+���`�!q�.":�����'�vp*�o x�Y�[�ȸ�\o2_��yA61n%{�C@Dc�1�X"�T�WP�@1�ۤ���nݖ�7�l(�(F�ba�Mofݏ�n�[6[�S���8%4�d0'ܼr��:c�\6e]��(��[ k ���+RG2�]Ib�����RT�5����kA��{,RK��_������'���� K:xC�+J����rL�i�x� �^sˍY)qF Eoh��AbSɁ4� ��О��+h��A�+����递|�l2Ow.�̘�M9{ ��!��@��c��ݷ�TK� �N�6��q��Q?��L� |����Ҿ���x3�Ӥ�����;5�+3=`���pm8k.� �~��u����z������:e��#3:`�R��! ��c�8Q��S#� l\⛍�@<� E�`nU��o���yB��~�������cֺ����bM�����c��+Wf:��m�`�Xu0�l.(���B�P�-��������;) =�%������<�3���{�c�PW|���Ņ�m;%=�Q�0i^��ޮ�ְho$Kfs���!�l�R,�6���= ߁� Ê �c�FR1�Y\Cn7k��p���N�)�� h�VKn�CSm7f�f�o��JY��y�-�FJ,�/1�m�O+������\����W�|���ʂH�cM'UwqMt?���ǯ���q�.�q�E��XO�u:E�]�B��^�n�T� >��e&%}�DX9�T�t��U5%A[��~�$.5�}��93ղ�����k��ij�U�R �[ĸ?N��������I�]��?�F��F������^y1�D�.nA}$2�d[Sa �4.ܝ��� yZv�5vt�<�i(�˵ȹ�N��kB(�*"�I�"c�f�k1 �`�������3šD��HBNB 4�qM��N�.��yIX�!<» ��0\o�a�&����9r �ݸҶ��b���T��GH�0�B9�#e\��&�`K.��C����z�{���FHƁ���x��]���x��b�,LFt�fۉ�?zӀ��0 ,��PF�-?���1*�&������;Ű��B��鄥���)nD� )�奃o�pX|������p �L�%8���&� �8���UKb�y�jz�������S�ɸv�;�а�h�%���:9�`"'F��ҍE�]1�� g?~Kw�J��(]_ ����DG1`N}�W1dId�C* �� ��!�EI/���C$^^H$^�@�e�D��ˡA� ,,�n(1f�e ���{Ƀ�B��ea�w� �$�*+���+�&66N���f��vr��x�F� ���L�Q��D~���{�wʅv.� ��{�N��s�K؛n��m�_@!� ���mn���ó�$N��@�B��q��#�IS*��Q띶i�L�W� ��M鉲����Wf�����C��.bK;x���5{���q�]^ [F�Uq�ktq^h�J�5Q��lJ ����J�����b��U")�2� �a�V��)�0DR��H���2@�3{ž{��8 &��Ћ�X�7ۭ8u�N(�ӑ|�`<�(6��0�S��3�}i[�{Q�c�b��xa �����^�ۋ���.� ̺�f�dOY����. �?�U�aR|w��.o�+��/N>�ԟ_��C�{wz>~y>:<|Q��_���×���c��~8=s��`��q���~==����.�������y�9�D/��F������ɡz<�P[GÀ�ڋ�>�7^_�F�~b�̂pL� WowZ�Qd�c�AN!�d7r��d�����}�I����>�x:���#5=� � c�R���ֳ:�����NF6dhDZ�� ���� ����|Sw�sڲY�W#<�[yV;��g�ʦ�u�� T� ��z�]CG/�?��/������!(<�麺�����՗DؔV�����H��6����u�x\_H��g���޹qz\�'� �������5O����-�ۦ!z?�顳�f�0����vƶ�����M�h3L�P<�[fYf�D� /&���0��`�k�1 �'B"���� ��ί��ְP�7��ѧ)�7"?��7������[ �h.u��V>�1��� �>+����Y0&��E��j���5[�E��@ִ��jZ��@�eW�����5dr�G���;� 0p��P�Y.������NU�a �5�..9K� �| R+� 㙀�OJl�i�-�� ��(VG*L�請L�U~��#<-<Ҋ�C@�gT��|~��N(q�m�U�/;�M.A�{Y��=j��ˎ ��BW*{�^�L��!:� �ϖt%��t�&�n�cfį‚�"ˋ"���I��a�҈�o�u�(���0uO���>�n�_�|�(!�dΟ�w�����qJ�_��1Z���_���w%� O�@�#6��Y%Rb�tm�,�;"� �K�jb�yj��U;L �#RN�vZ���K�p�����Rx��r~��yo�NU0���jk/QVrSS1�X1թ���R�� ��m��� ��x+. ��Uql�$O{�6�Q`Y�� ��5�'��ٍ�n{�懃�n>q��㓷G|����Rܴ������DAV�|�x9Ɯ%]��0#K����#�G��NW �Z̿xH��������-����/�b�o6�D���?�tt|xv� �3�2�}/���^Cgc����f�H)�j���x�J�)�~2đ{����+���ځΗ/H᯸e���CL+{>����%�Q6��l��V�b]�����3�@3����<�����m_Zq-j~��2�|x��ݎ_ɑ�U�����KwUC���+/v!�]��X31.�� ���J,7,���¾d�dЊ�wt%�Vo�j��A"D��IԽ8?���²�IN@ �1*�����$�d�S\��H�� �o��GE:��a���ԥ���7>� �ԏج&<�@�̟�A�#����@�C� �r��'�%�)qB� ��qs�җۊ�S�Y��*����ٔ���7j����x��W��Nq:>fY=e�6����xY^�13�l:A�߂��"���=���4����/wm���}}*h�%}�X�G:U���Z-� �l��Yxh�OP��Q.��+�v��AY� ݭZ��V��Zn�QW��� F���F�E5���H� dN؆�o �Eޕ�TE98l��*�&�XQ��E=� oh��#vL��.%)GZ��*7�p!��v����iD��'��ۨ��A*��U۵� �<���R�R�*$� ������ ��t�yM���� a� ���r��0�L��+x)n�&�^d�D���}Ov�:�)���F�?9B�U��K&�uIv�u�� �g�)�/焟�A,8P�Ԧ�7;�/Ʉd�7����W��gb�4�|���"hG��Hq8�� �^��z#Ã} Y�e�M�Z���j�e�ٕ�� ���