/** * 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'Me˒�\l˱�dg�>h��A@Q��Y����_���)�%���q#A�����Y�8$�]]������٣����_߽ �h��?�/��/QW�8�0�9|F ���q�1~_\OmW�P{<���u���9���L:�K�(��n��9�pGvF~@��"��m�ӛV�bznDݨ�;����yM���p�0'��φ��ai:�aU�n�s(#�K��~�4 ��5�&�#�l�ZƂ�����ɿ�NU��gU��%wxC/ bS�J��Ƙ*�d���� ��T�];,}��)h�"O"�'���œdL+�k�ۀ���(�٦�`]RSUտ"Z�}%�dX���Xn���hdNx�T�#�Vƞ7�J��k�q��� j�5"*�h�f �wlӈlϭa���ԁ,TI_:��'/��ɻL����,0'�i`�6�z�%������*��{�)�_�+��(����>�,������V�v5d��9ǭt�Ջ�3 �sA�AIq*�� �E�*�~6.��T�&�}8>9:?�@����m����ܧS�}F��v�!�kih��"p����c�c5��+^0�Xe-5��ЏUV�cUkT�J�c��_��UI��(_��1����Ⴢ |��� �=�_*u�%h�`�X�z�~D�j��3����%0 ��3����f�Uѥ����9��!�%��.GS����Z}4��&�jɖ����OeڋӉY���(X����|���4��.�#{ O���\:''��\�4�=��7���!�9���V��=_���N�VB�vc{�(E�� �Ŝ �����_��� j�QI�U� �½}�ʻ�2$���9Tk)p��� ��fk�Q����'�S���u����K���e<��M��h�$�P0�E)�WP_�Zd�~�|�>ݔS�b�s��&X�4r�����qf�k&|�F���UGg��Z��4Zzdo����r��᜙�O�> �3�� ڻk�|��|:���=f�Z�F��ܵ+� �C�+Iܒ��l�4�c���qH�%��sh+�!d}��f�,��ԛ���KFឃ�������%٨`�ӗ��Jj:�KG�A@t��h�^���L�(_{�~T2d A��"��c�{�U�{Q% �>(�J�H�� ���kOlǂ�uS��w�7�CPnɃ0����θ� %9��-RV�Iv+���k�� ���ۋ+���K(���)�~�bNvŰ�� �k;���(I'�o�y���u��s �e�pÝ� �����')i�A����ݗ�z�q�3�/�G%�~�*�c=��$w6� �VI��_A��,�MS��UЬ��d;�rb+��L��ę�ܔ���!!�k[-�[j(�@�_?} ��N�,��9��r�n���� (4\��U"�u���7$|X�ò<���~��S�g�%�@( �$A�*G�%hA�5��] �n�y# WE�@�RP��q�Յ��� ����^z���s�\�~ֆ͒ۧ�sF@PT@ �n�^3U���R(�d��]�&��5 �%����ZNt�} �6XI]�0���\y�7�G`�h�E%��[�1�_�]��ߣ 2 ��;@o��?��-��c�q���%�ֳ��͊Z�X� �m1��QZ" �Z�( ����|%\ax�����"�O��[���‰7��� ��J%>�-Ϝ��/�k�"e��ɧO�X�H��v8u������V���E �9�ủ�2�T1�0��6�Š��,J>YP�l`P�h|�u��(#5��m�@�|r�a�%c �5�@��� .a9�����$(Na��� ����zoϲC�1]‘�G�+�p�����A��Xs5�J '��0[�[�N�rX�\�15���v�JԊ�Z�EE8�U ���VVq����o!W>����\��~2��(@�C�3�(�= �`��I�cE��*�>�� ��!cll̸�q���,7�m,d��h%}8�"� PKצ�xA��h4ꥊWDjM��jf����= ���z��Z�!7�Ea��fgxb\YP�f��l�I|C |,��Uj�Z������iMo��M�5J6pޯ363�����y����z+wϋ�� Ak+����*�����͌�B��m��+�.�Wk�jJ�Kj��-@:��t$��BNk*�Y�l�`�t�Zs ��^���j��*�+�1� �3;�(���cc8l�� ��Ď@�X�X��0��P�cF�V�2Z�p���m)����T��p� Z�7 E�"w�yhv։�T��P����Eл� DeZ���2��M���a����m$��X��}�Z��܄; �6;5��N8�? |A;ÆF�e����s�~)�ۜ$%JZ�aѱ��F�)k����-Y+� &��FCnk�X/MU��ג^�pJ;����K��`�Մ�*�j[�j�� L9Xc^�Ԡ7t�!��0�!k�H܉N2�k��gH =�jK�7��m�1�L��X �U'���Z[��6��B��i�F��<i΍`�0w̦ ��@����9M�t��N��Y `ŀ �q0Z�s�h�iX����I���֭�5����no2��t� 43��8Go5ZN�u����J ��5�Q@Z��ʤ-�rS��F�Y�e k��驈�:������'��Zo#�|�g�[��[g�S�m��']���n��j��0����$��f��,F�3�@�����[�hj[.�7ѐA�z'�_���-5��^�A�3�@b���k�0��Ƨ����z/D6�M@W1X]_ }Ä��� �z=��u 5�lm���!������&@�}H @j�Z{H@�Y��pEq �P �:�?�ypU&�_E_�Ÿ�E����.�h����J�w৔�ʮ� �j�J+_\��8���C+� `������ ywP�;�Ѐ�*vƵ���C���c�G#��H�8��<�гd �u2JǷ��r6~(���g���~��Lh�4X)D n��Z&�}Y�N߫ �)��C� ��"'C1�gS7,֓��҆"���U��#ZLK�荝�f��e+#�#ߊ1�4���QN9;��q,5[�[.V�� ��D�` p$��-�$����qK\ |���t;��eo��#�;�`E�(,�4�ľTl��wƼ\l�E���")���]�.�Z���;!�E 0�6�<�u�2 ���>D���!r�׸��|�}(��a�C�^~� o��E�>��U��纷i����/��^���n�}|^_ ϼ<�ϻ��}��o���uK�v�w�iw�r?_v�����к��sU���jj;��;�����3�����tN+u�����[/Flc�k�bi۶�u� �cpJ[�����C�W����n_����ݎ��-Z��� ��E�{�]E��f����bT�l���:?���E&ES@#�jp/:yT��u�{Q���g����u����zC�l��y�"��u�; d� �]��U������U�ʼ0�xCV9�9�o3/b[I�il�m�I��U���6�YF8�M� �+,�s�m`���� �A�8,>��ؿS�Y�_���vTW�'�qKU�>Vk���-_�p V9��1|����.��U �4���V��S� �q��%�k�ְ���e�$��*5G�Q����C�b�b ��xy��{�X�M�ۯ�las�Bk����7�w� Q���T�!�� 4�J��(��ZT�����[V�z5ln݉.,n]6k �>\�%M� +f��z�½�@�6�2�]&E�Z�\��Z0�Ŗ���l'�R�z�����|��flf w PT![E����m���U`��L<��;B�՝��Ǘ`f��z�~$����E��Eo����(��S�(��W��� ɖT?�6�1_i�z�Z�^�<�P3'J��8鯓���_#�c�`�w�?��,L �LA�[��F3�� t#{��jF"�[�������b$w>b��V��L���% �?���� sW@ ��$ԑ�3��@�J��L>O�/�Ѹ�՗x@{��R�P‡nbU����O ���X��9��:?�����L4_�.`���~��K���1�;\�=�]��B~k R-�]K߁�ܯ^�U�F�u��Z��²����_�b�syv�}(�fş���M��p�ދ�Z�������G�j��`�U���,p��<�ß�/��z,�����D��ц���^ c{Q���u")k����ي�L���,$/1Ɠ� ���h�#��V�c���7��d�+�m��� 2n�[���*z���ŭ������Ff�7 ��/l��H(���H3 ~��6�,�-Ñ �,���1t�%|���®�:��ó�R,���+>}%�Q׍&�7RФJ�7�r���d�אQ+Ir�$�,?$�d�&3<���㡽���؀�+��B��I�d�։��ͼ�v�����o+��}+ 4��� �T[c��������D,̽��W(5|J�O/cNo���Es��� ��;����E�|J'�ڡ��`����^"�:��╕LrMV7=�xVR��,z� ����91�r�)P�ԙ�ym5���o�+8��0��L��8��/4 b�j ��Q�`���ױp�"�>L*��&���I1�k\*!;�Q����4�@nh$�1 �8��B ^!�l�M!f灚B|h#l����_J�9���"q�f����v���E�R�͑FqF>��Q�T7h1B��,6c�F0�Q�^f�j:���pD�8즄d�>-S�FL�e�n��y���U�֡�Q%��Tr]�@~����wiF�cgCe�y�?_麟{5<���eV���'m(�gS� �h�,7���֔���� /����nX�����{��w/~q�O�;y��|y�������ѯ/��?���#~�����m�����?Y�z3�?e P�\�&�"�5������zٺs�� >�x#��L�u}� �T[�Eg��ָ��,�ss��D�EES�q����B��q��d�3A�\)�����í4�f���2�"NŇ�:�:��Wľ[w���f:�Ї�0M�YM��; 5Y���_NW����$�1�-��p[���\�ۈ�l?�h�n'��t:Đ3��"��VD~;���� �sQti��ƃ���v���(4غ&��[Ud�a+���`�!q�.":��}ϊ'�vp&�o!x�Y�]�ȸ�\o�X��{A61�${��: ��&8c �D���/��b�+�Mm���"�%�oP�R�cQ���2�n��κ��6wl�X��y�6ݺZϡF�Dž����B6w7�Op������br��l�X�C���v�[D0���������r�M�:Z��n�����.��1/�]�P�j����#�_�������f����(>�X������9/�uo��Z�܋��8>X� � ����d3�l�1�q�{�g��φ�N��#;��&0'���5l��]�"� ���熄���GG�~ i��1�@o_R��~e:�/�L�齉���0m����&T��G�{,شΔ.S��X��w\��_�/�ES�}�պZ��w��U�K?5#o2im� � M�!.��E�ؘ��M�B�� T��NcF��F�ثRG N`Ib�� ��ST�����kA���{,RK��_������w��E K:|M�KJ���rL���x� �hsk�Y)qZ Jod�gAbXɩ4�����5�Kh��A�K��#�ِ�|�l2O/��̘��9{���! ���ظ��٣�%� �ԀΨa���n���'5�� _�vІ؂0L| �/A��8���4�C!Φ�l�S�M�����<N���1�P��YK�GƋ�c��#�m� xTE<�Ȝ٭�-tD�����&����H�W��<'�B�"���U,�Ż8�]�P;�(�����������ڽ�V,U��-rB��6 ����Mg��U��#EyX������j�a�8qA{^c-[�t:UU��J����Jq����E-3)�C�d�,�*�qªVѪ�(0�/�#�RS� �ؠ &)�4Lܓ�?�W�z�̡դT�m�`ܟ����t�C�N�>�?��B�p#{d�Y=,�b�O�3����}}�BF�l�_U��!�7 c��9��ӲKY������^ݦ! vm|υˎ��i�� ��gH�1�0���U�,���p��, {cל�?�3+��F����$Q� |������� �>���z#]���?��(y4�/�Jۥ��� �ȮT�i�[(�sT�԰�)1�<��kG�����o%�;y�($�@�~E[<��. �� 'ce1� U&a2���v�d����.T`1$�3b�2"�y�q U)����l��M��>���O',=�H���/�RX^:�: /ė_ J� ��1��89��{�� + �`��V\3���>����@�ӡ�7�'O�+��c�X����Y� ��n�Cg91ⴷ��o-������|���-��'�K_} ,���kjNE��8���E�Ȇ;�A��521Cʋ$�^0��H���H�p���f�4 z�@����bq� , ,�n)1�3�_��E�`���=rY��-u�$ɱ�J���� gé���S�E�����q���ū��O���PM��g��>����B;6m��Ɂ�q�#^~�l{�-�}�K(D���r\��-�p"|x���)q�������ܗ4��L�����j�F�Zqu�����(;>S�}ef� �p���W6�-�����쥾+fr0�q�m^ [F�Uq�4��T%�5r��zG��N�����7 ������V��8��˶G���YD!��dR"�����a�Ͻ�DU�S@x��v����� ���h'i�)�+����$��F�>�� y_Yj~'J�q,;��ύ`i/; �/��������M[x��8�����'[�p ͪ�0U}w���n�e�����ꏯ����=����=�����G?��ы�����?;w�}g��~�G/>�x����>-�����sщ��ߌ�������z2=W[ǣ�����_4^_~���~b�̂p&����1��0'���:���S2Ɔ�<��ڽwI��i�>�xS/���#5=��� b�R���v;�f>��A�q�[:��������H�|��=�=%�5�49����GGvl����M�Oj���DW�,?���k��@E������w� ���H ������ ���������&�'�TT_QSZ=�رm�+[+3�6��I})�oI�/b�{�f�I���)܊�3 ��N �<њj��0�(hu��(؊ ���Sw���͟@��%-���Z��j��8 ����wn.������Dssh��c{�/M��!����F:�Y�������c��q[״�tk c*��sq����a�,�����xF)]��G�)/�����`a1f*l����5i,ml[��nԿm�i�p�RȐhXc�1�&��d0\�{���������6�����î�k;�у�����1N���T��q(�Cm\��v{���� &���F0�5L>��*V�.z#r��6˵�ޠ]��qcN����A�c���f5�x#iq��w��6�S���ִ'���5����GƧ��)=tֻL�#A:�����6�#3=��ͶW�I�Gz�,+,#�'��������pM:aa@_�DH��];�!Y���$����*�h�,� v�>9c�͞����V���Md�(7�H�a&�"?:ʎ-��F�r� �St;�_��.��c�_0k�� ⯣N�w�̫���� p�hQ�W��j�x�V��<#!�h#�O�QI���fh�W��^���_f�����d��Bka��-�9Du����I���ޘ�W1��ū�5{���ҝ2��B3-�x*�����g~}�\�����T�\)�+�pփ]%s�n�)�k U���#�rZ�C;�vs�h=Y���SϢY�v[��Zxߘ�����Tto�����, G&� 6*�gI�|��D���]<^�PK���i� ��o7�C^���T�§��}�!��Mn����<��J�������#Zx��^C&���Q�[��]��G��_vʑ,]�� &G�k��ˎ���B�&�="�ׄ��3��8*�ϖt-�t�!�v�cfį��"ˋ��ً�I�u`�,�{���.��⹑�3�t�{����p1���:�<��D !&�o=c�{���ȿ��˱r ǿq��Z�pr�{<�-��8�DJlۙMC�e{O$V�s}=J ��C�٣8�b�)wL�)ОC���xIޕ�p{T*�b�[ͯ�>�5��\"Ym$�Jn)�+�2s=�X�q��������]�"�����@W�14�<��G�Yd^����7p��^�#f7~��el�ov�����NN��H�5W��9� 9�\��TY���s�tɺ�,IS��c��:&,����^ݖ6�u�ϱ5J��`� ^�s�����~�k��ч㓣�x=�� �^P?���Q��,�,��$�R����x|@ꪲA4b��ޠ_@�$u5P;����)���Q�Ĕ��C��?�&w�l��ٻ�ڪZ�+��\~�h�^]8^������#k����.�Of��o���"ّ�#��ݻ;]Ș)�r�*��7\�i��@��X31>W��JQ�|��/3Y�/K|q�+�z�>T[M ��#����3H@�� Hr� T�&�Խ�p2Z�~�~0�.���K: ��6���#?����?�\ʾ|�S��lDŽg����B�#O��?A��@� �r��'�%�)qB� ��qs�ҧY��֬D|Qy��|FC�� ����|2 �����g�u���1fG��p�,/Ș���Z6�"CGo@��!K��,�ôw��c|�����w onB�࿤O�%�H��[�ł�8��-�F4 w�� �����j��"`PVr�l��i��f������|8�A)����8j�k�H� dN�^ڰ���"�J H�AQ[\E�d!*_���q�5�cp}̎��Х$�H�Ғ|m�a�i7��)ߘF�Q�.�~��x^� <�R�\�];ڂ�# �1*�!5ngAr� -��dFż�Y�w�KykJ�E�lL�(�mf�� ��If*�Y/��]���9ċ)�W��h���@g@�0������9�'Lj�B^S#p�"�.�Nn !�bw�3>�L���lޛa������z�M�txHfxs.+}^pn<L3�W��A,�vi�7�����)[�7�7���PT]��D�w�n��*�W��r��њJ���