/** * 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�x�HSٲd;�r,)�ٶ��$l@Р$FѬ���t��/������S�ݸ� EJJf�Q lT׭������������o��!��� ���˨��g,�ytߝ�j����z��ژ��q�5«�gu�����_�8�þ2��u�����?t#�e�YL#��kv0�_���1��z�MG��� -b��l��z8�?�:��˩��g���fGn#�[�[�q_9;}��*���� �+.� �(V�$�W.]'�z��T�T��n�yf[�M�� ���w��%��� ɿì�?�xVyz;Q0b��RۙXW�;�FT= 7]ϊFt)le����򁹿S�КƁB�O*%�K�XV%��-��q�sm �����zxE�������Q���� ���&۩ׇ���FA0�V ]���9�j*�M�[1UH< A�Vz�m�n��#ƾ��x� U�W����Kl~�.���p<��1yY�M�yI���o9C�+c��d��6�Ж��BV�蝅0u�(�#�.r�0����g[~��8���dD��z��U\�l]X�7�M�=�pxtpz��|]߾t}'���_�t|vOh����>�V�g��t%���vY ���:��#�dD?�y�u�U�k����y�1?�U�~-�G��]��*rl���@O�9�&�J�Z������/W�Gt��o{S�~f��cР�(/�4�k������@�����ed�z��_�:ڈ�4���Է�Z+��W�/��*Si/)'v�V��h����k6 ���R�.UcwO�$�V|zI�q�vaySz<�Toz�2hN� �����W����5�o�g��Z���c$ws��+@Y�5D��S;�誮�g�{� ��~�Y @j����^� ��3� � ��Y��F��)�n����`U���{��s�ԇ�ڋh<�|�(����+��z-_�~�}�?�T3O�K��6X�2���ҕ��q��6l�=6>N�T~�������%�R�A���#�����Z��2�J �T�>}4�Y~�:��۝ܳ�{n�i9|gN�fJ>z�`�������AH�>e�Bh�ݷKA�E{>��S�rC�@�B S��5(�£8�Ua�JU���!Y�9�Q��K�+�!l}�ߦ�ͺ�����+V ឃ�`���#ժa��WںN&DL�A=@t���A�B�\��^�~\�T A��b|/��r������>(�J�HW��5���]ρ�uS��wQ0q(�@(��n'��2Ee��G��*>�~M�bֿ�}>CP��}zqe�0~ Qu*��OR,���Y����z��G��rt��PD��!f�A?�0zQ� 7�y- ����~Z� �Ͻ~�~end%#�2wXQ��gp�J?�hH��re�t����?�rߴ�殮�Ե��VMm%_���8��� g�t$�yi/�%��:J9����O��/i}ǜw^X��b5S�,~� W�o��88�Cn����FaVU�95�}�T��~,�B#)0�ʑdz�z�V /2j�F#-�a�)�猚a���&�%;?�_�l$a2'H+y��4=���Z*�FA_k0�k�0��4��0�j����ߦVD�[�VA5�F�4덕@ ��%�z� �̕@&�3o!g��=�]�[ ��]�W7�s`\�44K�<��O9�=�|��l��"�Z���`מgP�_��T�͊-[ Z�B0f���:V��½p-��W�C���ΛB� �LV+�G����2���XJc{�� zW���\+�8�����8LP��y�+%Q6r�Kch����{ ��Mt8�BA�-���8Bg#�n �R�9+JkT�Fˡ#5 �J[5��4;�Q%�,����k@a�J ]R]Jz^����ӯ� t`�����u��wU���J��$��%�J f�Z��� [���X$3m�.��~��ԃ�w�f��F�̴)��]t+�l�����{���j�n#o��4/�h�qwM'+ v�@�� ��9C5Ll��*1���4�2`����Nʰ2ho��Mˀ@sW�ܪ>PhI���.Û��� A;ǽ�kD@�V����oM�n�"�XF���5[�JZ qВ��͵mԙ�/k��P ��D��C�`��6��]쭷��2��-ހ�mr��]��'����n��ڽ�cR�B=(bl5u��c��n`4xc�f4q_��h��Us/�߄o�-���^�A�3�@b���K�0���gꫠ��/D6�U@W X�\c�eC� ��ӄZ���2�iwV�4�X��k�m�0k�*��4j�� �Ҫ���k�o��߂f���!P'܃�*��j�|+&�JC�w���^R���6��ŒrYݥ�a^�V��k��<��2�j X�a,�`G0I^�Լ�^�iD+5��q̀)m�ѫ��� �H`>R3�\�3���r����S�f�5��.#Ă�{|��A�;�`C?��B%�O0�k�8�E�:�|/r�����uw@�����5}�0���݁��|�� ����B�.���M��Ϻ��m��,��>��$���[6 �5����K讽����!܋�u����.܏�M(�����^ �2�}O�~vv;��1�l��^|�b,��7�Ev�R��V��KP��A�\xsCL��<�K�� M �����Q��J� �E%AR���d ��Y H ����2~����e��� w@��໺3ƫ2���Y �����ua�xC9�z�o� 橤�� ���x���Z��^r�c��k>�oVX��.i`��'�A8,?��ؿZכ�_[q�q���'�aGן>���;�-Z_\6��t���/n�]�ڪYiŌg+nmiZ�F��$��ǍVg�����r���P ����ag��q��\�LZlඖ�/K0W����Z��76�>�FQ�g����$D�BQG�?�h��^J�l�zY+y�yꪗ� ��B��@��T��诗�D5�4��ɞK��% �d7Qpa&PҘ��=�…����xa�[Ż{/S���.��8(�،��R�s��e���/R%;'tPr��<����>_�FY�X>Ïg��O��<�}���Q�b�*yK�J�k ����ؠ-٠Y~*"��(S^�V^V��S�i4�0Z������)#x1g5��ɋ+$عC�v��A�G.�xLN/��L�>�)�����un7�'���#���|�l��jX�;��\Xһ\<- �a{����a`�‚�ꤙ�p�oP�����ˤ�Ѯ�1��Gr���Km;?��ҹ��9gc�H�ތ��a�E�]d����Z���;T`��~1r��6�\XP����)���H ����nx��h�W��i�T�(�Ÿ4���N�?�6�9_ iF�F�Y�{�:��^��q�_'e)��FP�e`�w�?������HD������a)D��)ō�X����9�5odI���L����� hS��:R�K o5�>3e?w���� ��w���o�Oco�Q*�j�0,@� 3q��i��� >�s�:�X��b[�8� ��P�̱�]�p 3:q=F}��B���,��u K�T��!ղ V���]�� ����nv��9�/7>{�}��.N�F��'GЇ�Qh��q�- Zu����� �C*(~u�����Q��[�O�N#����<����-�/��c���OK�{�7����7�SQy����Q�W �hb�}n#E�1��L�U�H�ASZ�����|�d�N��p� >�(w햼!�H�fvj�RL�0���M���an��0��ϞY�0yb暌�����q�h��h�JD8t��{�[�:*�O�rn��{��q�,� �=�|�����~��� 5����M��������Ȩ��AZZUY�P����[�J������xt@�%���2Q:���&�S��W���L��–I���R��4�n�k+�|P���~ ��|�g?�C�4�ZB�^z�A��)͠�ǜ��W_��z��,)lw@���5���ŢNηC����l"x���9ⵅ��,�=�xZ���:z�J����1lr>i����\{�����o�k���qx�[ i�py#�k_hD��*S� �"��ױr�*�CLj���_�UI9�o]h�����>�� ���M��ܚG����kZ�Ώ���Q_��n�Iɡ��`�]�K��Y�FF�'�%��W��lə���h~�{e4‹�CkƯ�y<#W�~�g˷�s`�Q�ٷV�s����l��NN��#{�������G��U�������o�^�N�/�#��������J�_^�oO����ُ����/{��ٯߟN�({=>}:?��뙧�������y܎¿�~�x����������/���r8��q����O��D������\�����G�Wo.�O��4�P��|�(h G�u'��� ����B����� �Hl0z�@_y#��c� �}k]�#�ɵ�ҁ |" ţ� ^;�OiO��¼�'Lr���@��֮^� ­�=���s|ʽWqj! ׹�q0�D� ���l�c`! �Y!�j*��h)x����E�L�|H��F�XL:��u�:@xr���������D��CNaЋ]]����o�����:��6[*.��H� ���h��Y��Ր��m��f�E���ƈ$��=��~��������v�v�c�*���lQn�tD�7�q#��aD<�c�%�u� �T#�x�uZ�����m(q1EeMAe5"6��oz=�~�~�ް�b����K�t�f=�}�TZK��� ��LHLmc������br���Y[�C���6�[Dp<5��kJx<��w.���:m��{�6t�uL\߰7 E��…��h�.��I����r��|����4#;ްfC�9�b#���/�y������^2U���6^����"$_Y�K����>�2-�<�����#?��0�����\�$C�&� ��I�3�wW����ߒ����/�w/(�K��(�s�����(�X�n�����4XXĄY|agB�IL ��;�JL����W0KE䡜f��t�-Mouuԏ@�x���J��&t� fD�Y���o�͗���w��y�� 'Q�C��u��# װ�;��c�Ӕ���gq��;������Ԓ|�`c#���6��b��Q�_S�+���W|}5Y=�u�¾c^L\��/���i��Vz6��C����z�>�OP����a40PR��/��e�� �O�od��;d���eB�_���a풤��>���a��Ir�`�H�g�/�SZ`�D�AG؅�O8"���W��y�%؍mS�B�Mq玟��=��憃8=\OgcG�0���Y��fQ���GB�ƝAp��|�K:�W R��!�"���ڸ��Wc-�\����ay��d�dnSX�#�$rGC�unQ"�Mgo gv�Wo�����$MN*;����X��l1J|~�i�"g�}��\M<�u� .i_6x�6����:����f6\i>{�`ℨ��i�:%���u����Fͨ���Ȳ��HjM,�}qA\R>nؘ��_�W��ԣ��V��lp� ����Ƀ}[�6���B��cw�]=0�ٗ�i0���}�DN�<��.�a��������e��€V�F���Rs^��s��{w�l#����|l�V,+�;V! �"����n ���;gaw�Z��� zil���K=�{,�!O���e��a�nA�F�wmyZ���6c��:&�;�83G"�#��,�� l�hB,�����21�)�"�S��R4���% ����\ urf����f, �D!����4"��Q�EF� �eL` �H�V:��W�����Á��Z�('��ADJ1�� ���W��Nc �',�Mt����b��B�D�?�N�Wq0�;�9U+2�7�h��e�(��'�O�+��#]ۭ���$@� ]%��� b$eoq�_[��1�?���ɧ,�O!�;�� X��;�m�IL�|�4� �q`*������ �(�,z�M�"��R"�A$?����ȇO��n�@l��������:'//��pRY&����G! ��m�$Vy��8_l:���IeAPJ��'�M.����(9z���ä3�Sy�)-���#� Zj�/�|�#q���W3[���t �<�x�,�4t�K��9N��SR%�y��<���w��]���ԏ��z�2���XB?��*;9],|e.�F��0n �+;O,m���=���|W���89{����>[�����h�l/~�3:����?���`t�\�#�j�x�z}�a4���}r �� a���^�+�-{,H���L<�3m�΃=.M�K��Bʭ��G��^~� �Gj��Y0Ѷ��e��R��!��p�`���-��������Ȩ}G=u-*t������fgH6��b�G(�'�Cx|b�|-@��.�8@X�#�]���yp!|����A;O/��ӟ����ȟl�P}E�MY�L���� 9��̹U�xܜ+��⃜�ޚ�:n�c:�9y�����@����>D-&��%9�=�?�,�%��1�+]�1�Z�cj��fSV��q���.�%��v��j�=��Tʱ=�'�E����Q� ���\fO�W���wM�葽n�eM$�d�"yi�-D�z3��0MY���d������� �����R�x�1��6��e�߶�4wJd.d�N6,1�`�q�^p\��'���r0�Mβ�7�x��zc��z��#�A8�E�-_�j�E��������Y�Yp��Z|0�y�e���E���p1�#�Z�5��6�k� !\�+��=�.&�dɶnyFiy�JR� ������Β�$^��M|0�%����dM��&+��LD��)& p0v-���N%����1�J�To�e��H $y����Ła6S\��y�W���^���<��Aa �r�y�4?}��_'�����Ma ��DVĄruj2N3��R~i�<32���%�;N�������"�? ��f� �:��a�{������j��T K��w'�9��H�ݍ@)�@�G��Y��%�]�^�^?�Q�_��㭃�[Zcu��#�������dW����%��c�z����ev�?��fZ!�R���U�};�&%?IE���]��ۧpՃ�*s�/���k U���C�jZ�A;���h��<si�I��<���fg)|hM=�����[��<�9/ Ǒ+n����!D�%�8UevF�Y�Բ�0 Z�›ɧ�K]�p�����(��tC�����S�yyqK�"6���ǥg���3 ��JV�gZn���:��Q�?�5G2w�'^9��Yo��.? ��cM*Vo %�g�zqT�-�R�W�bū�YN��_x���� ��h/c'�߁߶ ��M�0�K�F�O��&����'�b��ɽE����|l=�w�с�Uȿ,\бpǿy��R9�pq�{<�-���U�Tx��Kɳ�% k0���%�����a�沌�?"� hˣe�[���{)�;����1n-���1�5^�\!;ym���J� )ǒ(�6��X)p�Ó��I���]�-����b���y4�>퐛G�Y�^����Wp��^�#a7y���lZd�C�|P;G�oE��Z�R^!��b�'D꒬�$� �K�NyYҮM�3��^& ���������u�e���MJW\e�!^�3�đ}e��5y�����������Š@�#�9|@�\+� f���e�tEU�7<����9���J ��(��q��'�k�ځΧO�H᯸@�B�'��b��Q=��e�������r]���犫t@��x��h���ӯZ,�,��_���_t��PrOIΚ���nt7c���5��;(^v��s�j��yR�w�uu�k]�#*�r��u�G×<�W�;�U�Fs�9�;m �@�#���g'P�\�;.t ŋ#(�P=3�{��b�����`�S��S��t��7|�*a�z�3��0�)���'��'4���<à,��B�# ��M�t�1� ���)� byR�� $���@�|�Q\n�K$V`U N����_��'ϧ�i$_F�x8�J|̳z™l�@#���"gf��t� ���/U��3�R�wX��B,�_7�k���«�PI/�/�č�"ҩ�_F�r� 8N��-����?A@�=Q?W^OS)"夗�v{�]��lr=R�r��/]P ���y5� Uc 2�<����� �s&����\����!��k� .��} ����T�iY[Q��&�5��77�ۊ!����O��mP�'�T�Vk���k�yd�?N�z#��|$'*���MnV,��y������A �Ɔ0�b�3��W�'M2�`��x��a�oohx�i_m��?L�I��t�� ���"�yM��'�غ$��5�P�_���,2�A�uo�'*����v���pF�x�n+}^pm<�^���_�X��)��b�d��-���Tii����hv[�nK_��mM��۟����