/** * 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�x�Le˒�\l˱�dg�h��A@]����?�Ӽ�����)�K���q%H���3g�(�tW׭����x�������w/�,�;{���q w:��+�K�F ��= �+�����^]�mW�Q{:���y���9����:I�(��a��9�p'vF~@��UD�pӛ7/|��܈�Q�wS� �-9�"ÑMÜѦ�7?�M��x��]�s(#I��~�<�idsf!�F���K�/�f��s:��mz�{A$Ar$]�V4Y��6��^�v���i8t�q4��p��C#�%/ � �2��'�]��: ��z�Y�gi��؋���ܸ���1�2�9:F0�;Hm+���kB�O ��ȓ���Ax���I L��k�ۀZ��(Eڦ�`C�RUտ�؟��� ���:�� �� ������fsCe�yS�A����iI�p�:]#���|P����m���� ���;��*IGh �%�y��r0[�< �?�.yI�%U�� �7����o>�� 7����BV+���MUkj��X���2B�gNG�:2�,�4\�1��G���~B�6��Q�qn$ޣ�-y���������ms��v-�B9�����l��LC2"����i�HC�����f�\(^0��d :��ЏMV�cS�(������=�cSjH��W|w /���n�� �_p��������8�!V,��z?�C�]�YXH�s������N�QW�)�ts� *|DNfvH&�C �E�$O�K��B�>�,\-�f7�����6�n�N��_G�ˋF���G}B�(�Fd��ɘ�ÚK/�! �+熳�G�Z�f7�ah�#/�)���׼�O�Go���Ԟ\բz��bΐ��MBޯ d�*&���fTSj� �E�=D�ʻ�:$��� Tk-p���@.O���� 0�jT�OX���Q�b`��j���e<5���n@�E��H�`W��^A}�k�IG�Q�!�tSO��^ب~�6����cL��(�h�� ��2��d����Pu�q�����F��H+��9������}T� ��m~��^�Y��O��f4(h �z�0�;�%�EWUߍ�00G�P���ڰ ��k�lǂ�uS��w�7�CPn̓����܎�� �F8��[dCXŧ��W��Y��fPT�H�^\�ԏ^BAT]�2�'(�T`+�e�8�^�a�=DM:�_����,� �9��z�n���� (4\���(�w̺�Z�; >z��Xd`~���ٳ�X ��J��D�#����5�0\ �n�y# WE�D�ZPo\�l-��[Al�i�=�l ��ιL�� �5wDE�"�����݂�f�A'���h�w�l%�Q7�(�W�X��Gh=mpЅ�(�ʴA%mt��ԧOs��9?#D�-+�6�r�i~w}���e �Q��z��# �|<0gl�_�m= ��,�5�EJ��і3��� D�^k%a��?� n^���G����!U����Sp ⱆp� -%���e��Z��<�g.���+�"u��ɧO{XÀ��vl������h���h�[D �9�Q�'�2�T6�0�o6SÊ��,J>��J60h)�n��6�Hͩe��)�C`Es��s #�k9�,{��[8E�9�5`L���8���ڲ��w��!�H�#{�l��.䎽������s9�Rg��4[�u�� 9,X.˘��v�D%�����AQ�~eñ�&��24�i���-�ʇ��b��˸�N�y�(q�x�ٱ��76�x��u��G�Ba8d�M��71�1B���F[�B* F�D��"�<�� �tmz� O&��T�Hm�^���&$�e/��~��݌�`-�"7�Ea��&qxb\YP�fM�v�$�#>� KҔV����b�ɧ�4E�;t~�r����qޯ363�����y����躒����Eײ �!��e�}�ceFF��?F@�Y쮃j˭!i7[k�Zr{HZ��-@:�k�t$��BN������� �Z��t/CEA� �c���ØW� � ;�����cc<�E��̎@�X�X��0��P�cF�^�2z�p���m���؜�T��p�Z��E�"w�y�V�U(c`(�E���"�]A�2�xol���:�s�0@U�E�*%V6rߧ�61���B��A����/�A����Ѣ�St�s.��/�`�3��DMku,:mӱQ�6�v��뽆V'�L�i�N��Ab�N4U}R_I���vV����4]:0�� y������Ro�^b�� �Z�������; M���I��`Mb=� )�]�5�]�wq�2��0���XS z����6��B� mй���yҼ0����Y���%�k�6V|�洆�c��D�j+TЎӀ�v��G7N� ���OҀ@���ݪ>Ph����&êJW� A7ý�sD@�V���X�o,.o�"�XZ����;�N:1qВ���m�Z�_*��jh���8�S�zJ� ~����6��Wz&��0�mF;��י{ҵ a��.���� �:h��AR�����b4=� ��lM�Ռ���p~�hU$����5��Ί�K�5~��B т�p%����tu[�Ȧ��2k�K`�o�uB��0Ai�:_�b ���6�hk�;��t�@tBW�u =i)���>�t�[��pYv �P �:�?�yp�A�?E/�b\ڢ�Ipr���%�۫J���O)��]I��h�V��܊q`�#�/��H�4�U��븃�7Ë hM�C0�+`J�8��~=5|4���L��Ì=��\'�t|۽)f�/�"@,�{���e~��Lh�4X*D����A,��~� ��9@S�-� V#�EN�b.�nX�'=��5E2j+/���2��X+��;`��O����������B�.���U��Ϻ��m��,Juug+}�- �V���%t+/FT�Ò5�{�T�@���ju�~ nB����.><${%��l��5��������в��{�Q��4(.2܋�2��4㥆��Zg����0憘V�y��p/2)��U�{�ɣ*��܋J��?[7H'���- %�� e��%�; ��l��+�wyg��e8���&N� �ya��,s�p�?^Ķ�&��� <�Ɠl_S���6�YF8�M� �+,�s�m`����A�8,?��ؿ�s۹�6"�Ik���O􃞪>}����wضh|��9X�mM�˸m��֖b��l��֖,�hx@8�c�!y������n)\f/P9@JᮢIwқ�v[x�TlZl�//Rp�K��s����-l.\h����f��6!����0�Q�S��Y�0ʮ��0�'�;��.sxn��k=�aF�9,,��5Q�%M��fd�l���I?Vpn$PR����B��=��s��d��5��T�ܦ�D�#�T�B�W ��}c����%@6��1�z�������@��OG�WS��� 7�����tՀ�����9��]��� )!��!4���r�vD���Sq �'���b˫X�K�3�3� ���e�`�x<�������% ��m���<A�C.�hFN.���}�R2��Z%6�o��nxK&+����T���jX�:�3\Xܺl������l'�R =Y�`c*�p�����U�V�9�[[���� lP������qu�m��%�YGY�B�ޯ�2�������ϳ�m�J�2�����%S��l�nB����,`̧ �\��R�������X8Q��I�����A;|���H�aeaJ���e����]�a��lB�0��ˮ�`$b��e(?`X ��_+FBq�#�nE xδ� .I��9-?v��Z��&��$�)���P��`��ٓ����y�}Dn�d�m��qe)�\���G�)���wIf~=q �D��rԜV9�d�o�L���:Ov�o����e�HZ����:1�U@�sT>X!�v,��"����cS� R��rH�N-�XN���U�!�xc#a��P��I ��g�lr1;C��Ca� �=ƛl��S�u ���6���\�.�y�?_o��~-<���"����6����@��U�QQ�`kJ�W_���X�*���-: V,�`�>���� {d��� S� �t��~:T ��X,E�Ӫ�1E�$S�ei��˛|y�P�"ي"���s����4�EbY�OS�&�l��v���:g���xq��a�0�C���j�]����a,��" G�� �9��d+��[��9�4�0`.tX��ݙn��#Y&���?n��'Y��$�:�u���o�چ���b�r�k��5�x���`A���?̆ ��-��q:���vY�gE��e���W�+#{� �q(�l�����s��8��i�;�u]�9"<���ϱ'ީ��Єq���&~��w�H{�,�����{>M"$ĉx`�0��e[�%P�� ��k9��x�/�~�)������l�,���=�B�ͷ��Ҁ1q�L<��q�slLtb3i���iҌ��� ]nj� �7",A$e�� ![D.i��+��� �$) }�����p��9����.b“Ӱ�h�����6�O�C )�ث��o����_ar�~i��΃���6���(4�\��r�J�{؊�m&X@qH,_xA8�}Yt�}ϊ�ͱX���ow۷ ���ͯ���[C�^��A���hN ��C,T�%#P��cŪ�v�A�-��P��֕���b�/�vu5�~�v�ݰ�b�B�Sڴr��@��� U���Bv7���p_�[]�߱ 9`e�4֎��""��D��O�v���G���`c���R�����!�۬a����I�p�KT ZZ�u�||$U�k�� ]�����aFz�bE�1�r%e���/�yٮ{�Uar/*�����W';47 �f�Tcb�w%/B�_�;���#;��&0g���5l��]�\ [_ɏ�*}c�������)�^�4;�Wwf�l�L�g��ū�ղ�U���� 6�3�Er�5 ���+���+��$�-����N�ΰ�[�����',�����_n9�|!2K3�RA�� ����F�F��M&��RG2NnIb�����TV����ѓk�%��{,SK�a1��F�m�)��|uÒ�^S�#�vX�C6 O1dZwnq2+2�����!`�7�M~V}@�x�u:��d��=) �ْ�L�Hz�.��Y�w���֞D�:@³3�� �UQdf�r��Ƅ0U��u���֤lWKfs_�S�C��%ں�������ռ ��,'�^�)He�9 y��v[j�/�&cCnS�/�ۓ�l��iЉ��F�mZ�/�>��eUu�ם�3�T�z#���w�":�P��0���w��k:����g�k2|��\�7�]�-撴�`�T����!�W]�n�X­ ��e&%}�&��e6�t!ꤙ���|aʈK�A�_l�� � M�h�l�=k��fR��v�0����l�|�o���e��w#{bCH�5Ɉ����nV(Q��4~ �2�6>6����«������C�i�5�\�]�_��Ʀ!����-r�S�w�n(�<_vs�1���v�e��ˁ����X��-�v� ��:r����Z�w�Xh >�K�����*��G'Ÿw���8ޅ��_ s�<��s�ݹ#�]n��(� a���8{�Y � ����W_M1��|s-���g!&B�K�㉮wn86�vs�A\��08>�l'N�Az@X ��C��\�S�Ǒ�R��G�l� ���d�A&���鄥���)�w�)�好o��J��KDAic��Jv��$����ɰ� F9l :�jI�lN^M�48Ax�ԇz2.�N��H�v::f *��?�s�hWC����]�rv�ݰ}~��B����ۇ��ǧ������m|��d���������=��O�7��?'����_�O�?����F�|q����<����w��������h_=O�����I�j��O�O;/�/?M���(�OfA8�熫�=B�(2�� !�f}�O�@Sr�WnGL����c��.��9��p�=Rӳذπ�)��N�ff3t���л;�%�#C#Ҕ��T���'��&����4͆�2<��!�Ɠ�<>�U6��ϫ�g* ,P|�p��w !���H � ��'�� A�����&��*j$��)��������ݦ�=����]H�4���޺?w���Jw'��޻#5O���60 Zޚ+2Jv�B������n��� \��֕[=]���mQ�����7��ۅ{�D��DS)����0%�B(������,1ڷpk��� �Qh��q_״]2�:�\����ę�f�B���s�N3�/��0J�r�o=R�\ ����?��b2|*qk�d3�4 {��۞ӳ �-���B��� Ì�g&����sv;|v[`&��[��O�vۂ��pR�,�1㕰%���!����Pk��q�m��I5����3�5خ�2���p5՛�C�^� ۥ6�kýR8uW"�{�G] �_#Ȋ��� *��;c@ ܥ�[ўx����&cZ������Yo2C�D�b|;c�p���|F��� �(��Y�YF2Q ȋI)�- �9�t�€�ĉ�?�{�gB���{\8�5,�OV���q\���ځ*�|��ux�[���J�>�\�I��`��4-;�UHO����2 73�\�]�{�Ŭz�K�����d^�_�;�|��NW �U�[ز�H��!�ሇ͍@)݋SD%���������� ���EFXy/�xIvi����?���CTǛ�.�E�{�MI���>J�2�k����<;{�A3��x*�����3��'פ�'.()��wBv?�z�{w�ٕ:5r���0Sx��Q����#��4ZO����ܳhr�]����7!=r�c&�[�s<<�Z����$w�F�qL2$09Qez�O�&��kArZg���� ��X���U+����>ݐ��Mn�)wy�ӛC����Ӕ��k�J�k�o��l�{)��J #������?fo���� ���? �d�j\D������4P{�h��IK����7��v?B�U�/�b���X�=.�7q��rb����o�T�:Ƥ���▭T���ȟCAjŽU<p�I�M<�m��_Q�E�r8Rab~W]���!ni�q��I���?�A���f�B��WKo�`?�yoR��/Mn�h���!;�� =p\9���x�/I� �4�-�J���bM��,�̈ϒ��"ˋ"���In[aw�����u�(��{�p�Ƹ���nn��R�|�(!�dΟ�w���~/�w�����r�n��7"�]I#�.���C�hqV���^P��$���HT �{QM w��ڲ'q�b�)wJ�)ЖC���xIN�&���V�Ÿ����8�5^� �\#;Ym�$�J.*�+FY���������IЍ^������fGW��P�<퐛G�Yd^�����p��^�#f7~����4?�u�C��9ࣅ�\��B���J�fL�)� �O/ǘ��sfdI�T;ǂ���� �Fi[��i��6�U�E��r�_,%#^�/��4�%�}88�?����i��3�>��ϵD/����3��e3�G��~��3�QC<�# ՆA?�H��Alw��4�@�@�ӧ=��W\sIa�!��=�l��A3�Q6��l��W�r]�����3�@3����U���/D��eZq/g~��1�|u��ׁ���\��� ���K�%C�x%�������bgq1�L�����K %������Ș�� ��Jz��o��^W�D�TY;��{vz ���eC��(�.F36T�i�A!�%�� ��hH�~`;�SZ���q��Ow��1�#6� �G�)����Cj��O��g.��&'ljeIqJ����s����!�V"� ��<�p��!��Zn�|2[��e`�c�| ��3fG��p�,/Ș���Z6�#C�o@��!����;L{�i>�����ܵ����M���_����<�Q�/Sk�X'X��V��~��;x�g�ʛ�v��AY�ѽ֠�W��Vn�QW����=\�̳8ji ��)������:�}~�|(1 ��rp�r�U4L汢�5�v!.��# ��i<�ԤiQZj\[4…�k:�nn�7�A8dԯkt��?&���O�T�+�kG�<���R�R�*$� ������ ���u�vK���� a�����l��0�L�=k��[�8�;{x_�#Y�f� ��6� H�Xx��9A���+�55��!b���B-��g�)����A,8P��NS��/Ʉd�z�����gb�4�|���"hG��H�=�� ����z#í�Y�e�O�����e�ٖ��^U;�Ҥ