/** * 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�Le˒�\l˱�dg�h��A@]����?�Ӽ�����)�K���q%H���3g�(�tW׭����x�������w/�4��{���qMo2����K�FM��=��+��9���_��g��L�3��=��y����\��B�!�iѠ��]jzc'�� ���*��cz����b�^L�����E������*�iMi#�����t}�V���9�� �� � Fg46�55È�C���ғH#���J���0�� 9�.;�mz�XTa/2q<'v�|d�.�M�� ����������ܳ�+��4w�����Ќֳ��� ��G;)ٝ�y�83sBP�5p�pBw��V���>D�W ���ؗ��I&<��$����6�J/A��� ؀45M .��f�j2��B�wl/BF�4��;��v�1`�ԉ�O��'��bf%%Ӆ��̘J$� @�f��eƎ�5�(��r�B�d(���h�]���tZS�44�����%���� ��!�����_�)��(��z���Y,�к �� * PQ"FE� DCWX�������ID9=��Jcz7>��f�1ߒg�>�� �6�/��/Գ������1���$"Cr-�̈���4�~l|lD�ꇓ� ֎��P�!��`�?6����͏��q�5>6$Y��xx��'w�6���#�'|����4�����b��u����Y��F��#��0(P_�N��s;jW5���]P�#r2u"2v\J�/:$eB=6j��x�Yh�5G����fH|9��n�N��_��ˋ���<@}B�8P9vf�d΂Aͣ���sӝӣq�~��(4DZ��T��?��5_�����/�8�Z\�߀^�)���I�5���Q�Q��Ԋk����nz`/*��W���!�vO�Zk1�k�].ry N�i쇡yU��x�:��uP�6��pX�O�I~(n�!��Gb��\��z�կE&����M=S���^ӂ��q��|L��ǹ�i6��]�"-���?���h���{nJ�,�$P��Q����4�mu��g#���=�j�nI�VJ>\J1R� )�v<@��˪@8 ^9Im3:��G�H��������g�>NjE8��Kӱ�A?�h������ _���t�-?�O�F�C��ݳ*A�G{>���S�0C�A�#CxS8*$��x�R��j�d�.�� ��/h�aK�����ھ �s�w������k��p�AI�ka���l� �������>xPݤ�����5�>����i�L��F�@����X�^tU��X�Bk UA���i��bP�B�@=�`�64��*5� ���rk>����|�v�}m$���o����O�� W �Y���PT$go/.-�/� �N��� �8�i�/�A��NcQ������5���3��z/ʪ�;�d1ח7LS����pP+� ��g_�k�?� nU&z I�|6�a.MM��_E��,�]Gk�4 �,�V�Z=��|j�sJ|"�975��#hH���VD+�J �����Oᗰ�#�;K��~m���[ �(~� פ��j��.�V�N���^8�����^>��}ǫ�BY�$ z@T9��A �����B(w���*j��º|�C��T7o��g���wlh��7�2 �6lռ!�3:��"�b@w ���B�"y.w�l5�R��(�W�X��Gh=kpЅ)�ʵA5kt��ԧO �eޜ���V��o5�,����{o|�r�(H �����o!>��;2�/����nԚ�"Y�h����?k%�P�5�������7����c ϲ����b���)�� �XC8񆖒B��2�_��G��[st�uy�P��7��ik�3���v��>�R�����D��0��Pƌ*V%#��fgX�GɧT@�MU��í�F��s�:�S�c.cp�a�}-g��eo{{ 睠H4�� e�'��[[��y5  y�̰�M/ޅܑ�4u.f]*��uWf��-��Y)��U33�8ހhDS��B6(*ơ�b���M]ā�7 }�\ЗbW 4 7���� �%�\�����(4ë�M"+b�4@�q��P��`c�M��r�簸Ѯc!k F�T��<�}�� �tm������L�Hm�n���&����̣A~��ݜ�`-�"7�Ma���nxbRYP�VM�t�$�#>� K��f����b��g�tU7�tv�q����qޯs6�0�����yd����z-Bߏ���Bk+���*���D�͐B��]�R��j4W5�ր4�[� 2VHθ���Q��w��_ ���7�N ��^���j�������L�N4U&!z���hԳ� ����J�Z�f+aӥJƌpݞmv��Νs�VB ~�56�A���9�^�`Eބ���/�T��P�X��Eл� DeZ��ȶF�U��a����6�WJ�l�Gm}l���:�&]R':������Q[�e'�,��\���_*"�6g�i���l�t"���Y��z�+FW��D{��5�ݖ{:$��D״'�����h�ո�~M7 �잖��dC��zS��z�I K�k���<�e-S&�e]���If�`Mb5�)�C�ʭ���8F�iU�WHv� ���ٓ��� t������۷��|�E�f8S�; 糕�-��Š�ٜ.�V}�N���b@�$ m��yt�4, ����4 �zr�V���@K\�7VU�� :9� �#��-��:|s~y %��;��( �Նu�N���4�c�m��<����MY׍L�~���72��=l���f�ҷ�-ހ�m1�ݞ�ܓ��c}w�e�nm��E{�P��h5u�`��f�7Ye�ƭf4sl���hȠU���oA�����Kj/�� ��A 1DBå@�b�3�UPl5"��*���e,�E�iA� ����� �lH��t�+@Z���oc��^�C5V�t��6{+@z�V�N���3a�oB5�������5���Q�Ť�Mi���.���*J�����a�Q�*��2���*�bq�����G�_z]N�4�e�ɫ���7��) iMu"0�+`J���~=14�T�LB�.Œ|����\��t|۽)g�/�"D,�{���~g�,h�4\(D�n��V&�s^�Nߋ ��V@� ˑ%"�C1��3/�֓��Ҋ"9�U��U��cZMKW��FesD���Ԍ�ȅǷbDL�Ͱ�|�S�O>p�fMt�b�� hMt �G:HZO _�+��ĕ�W�M��[Y�v<� V��By��&�R����s��2���e�EZh)���-�Z���!�E*0�6_���^�{Op"k�����k��z��>6�0��v/����F��yu����s��47�g�mm/wR��>>�/��^����������qw���o��;��;P��/�?��}�]h��wݹ�6�Yw5��|՝EY�Gݙ�R�t˂A6�����z`ݵ#ֱÊ5�{���u��Յ�1� ��}U~��!٫@_ec��I���n�_ՇV-U܋�J���@y��^d�-��,5<��*�Ņ�17Ĵ�ϳ��{���T�(�܋NU�d��^T$�ٺA6��m��X^o��-1�!/Xe;��p��\��;c��¹�_5q�H�O��o�"�s��c��l+i�?����m<��5�����0ی���{�}w�%x� l9{�0"3��Շ��cs�W��f�?i�4�q�մ���fo���/N4��p� �a��]��RM�4��V��R� gI�3 �����߭����HC)�U4��.c` ���M�M\���E �c 7En����͹��c;ߜ�l�y!� C��7h��^��hZU3y���U��s'�ث�L+vΩ`a�_/��z"i�w4'{n�h.� Hz�� #���d�y!\�;l��%��U���f*�6= ��Jt����s��i���)��c:�)9�q���9d��.�&Y�^��������<� m�ŗ�{Nq�*yK�R"�W"h���� m� ����*Ob�ŖW������)�4C ��R��p�4"x1g5�oɋK$�9c�r�+�� �\8�\�+��ȣd�[s�Jl��6���L��/r7�Y����au�L}paI�r� 1XK����(��:�XX0[������֩˸w�Te�zS�k�|kJ�Զ�K-�d���i|��flf w PT![E��nm���EU`��-��w���;o�O.5���:��z�~$�����Np�Eo�� x�*��b�(�Ÿtku�m?l|�cc>iz���R� �M��܍3~0N�뤬$���:����E�+( S"��.�GP���"�����G�3�=v�#����-G��R�F�Z1R��Xu+�s�k�ڒ���#����+� L��H� �j�|�����?�'�'h�E�Z%�П�ު�T�1��[�XF��<�S�>A�|�%J�:�X��b[�8� ��P����n I�������!������u K�[�w��!ժ�W���]�s���Q������������p����� �C�0��`|�V�2ñ�/f#j��__&�w>E�;��l��6�������0b��˱@&^��.����m����B����Tf�B@{��d�3�?3�!����cn&�*��o�i��sī¯2��q��b����.�7#�!i�FWm�1����8@�5�3����l�a��h�D� -�>��,!� �M}[��Gqe��3�S��Ԗ ���ъ�.���!ų�-�v,~0r��O��qռ�Z����5�N�0�v���ij]~Hd��Mn�ʯ�͓s���y�}Dad�m�qu!�\�ōG�)��4vInf=u �D��rԜV9��o�L��v�Ov�o�U��T��&G�m��H�"1�UBepTX!نv,\�����g��2����s%�`�02���,� ��)k�� =������@�$[cӊ�����Q�����KIs7'���q,�,���ȉ�#kbb[�b�3�)�ҧ�0�X� �"F�w�����,�Eԑ����.h.1Q!.�=!����T�n��v��2�x�u�Ca���y<�\W0P�6n��-��q��|����v6��ģ+)���M-?mCY>�MD�Xf�1�����p�%ixI>����,.ޟ�`�2)��c��|��K�F��4i�`Igl�g@X��"T2�*�0��OruX������J��.�]Sdѕ��{�П&�ghF�S�T�������l����m�� ^"c�:H���d�Zx�?olU˾�L�@�b�-�tF���*:3�V�U��,+ � U��}w�z�HQ�����ߏG��IQ�r�G�N�_/�g���[�����ei��8N#�O���&���4D��i� �t^|��J���� �r�U��/�T�L��g��y�� ����zl�8q�����Mu1kD�d= [e ����~��4v�-���vS&%��j�v���B,%�����]N/馾نgS����F�#l 4�!^��W�j��g�(#�k�jz� 7�� �� |^�}1Z����������o~v'������U������Oo�^������O�y~�_O_t~�y//���~�}������f�s>:����Ӄ�)�^OO��/_?u5�w�dҶߵ�:a���/��^��>��p������/�㋟ǿ�x�}�G~���������^�zs1|�#�� �M�+DBk8d �;%,��uٺ �� �=�x#��\�wC� �Tk�Eǐ���2��J�u.u���}��0ח�Ct Q]a������@j �2��(��)��Hs���Ѻb�#<9����{P��F��t�!���"�+�����W�^�����V�A�E|�{c�]��r�*�����L���X���h���$��=+�w�bqr,��!x�Ӻ]�ؼ�=v�(7�:��|b�H�GcBOq�b�p]�_B1��;Vl��n=��EtJ\ܴ�����e��@��u?l��l�l�N���)m�v��@��O �%d�a��l&$nv��o}�2䀕Y������m$���� xj�zkJx4��˫u���:t�5L�߰6 x��…��l�.IU��r:CW=��~��xX����c���Cj���ϻ}��4�� �q|P� �K�]Z��d3�l�1�q�����G�MIy‘�Nc���l䙎K��T)�����G�Ti����P�S��~aj�/�L����^�X1���ʦ:TbPD�;/�dό�i� �l��;�^�)��2���u�{���5�;��h��3�z7�@ڌ���fW ����)k��D�8f�h��H4���C��H�9-Il*Z�1׈�ʲ�8h�l��B�b�UjI> ���H�M>����h���kj�Sb&�+��&^�i�\�.,H���9/�F²}l�&��O�`Cio�Φ��w^��ܡ���'ۊ��J���S��Ss<���<9�}M_ �����mE�?A�((m�3\Q��}C �CS�p;V��Ȇ�5�T-���廀'�C��zPO�K�I<J�v��,A�'HW�!bЂI�[ ����c��r���l#�D�wφX���6��$��;���� �n*������� �(�Hz�L�"��B"��/�%�HM�$�m�$�@���|ܐ��%�FG8����4���o�&I�UVj�?�W4�l$�2'(��m ���x�Á�A��<����wć��v�؄Տ�;����Q��S�@�vT�P�4AC�x�+�p"|x���)q���g n�c�6��L��E;��7z��:����qN�����2�݈����;�v�X����}������ɳip�$�浰e]ǽBAg��3=S�~�]��h��.6�'B�O6�e��W?�5�!��~����<���I2���+��:@�gƞw�fI\� ��'�o�� 2p& ���f��F�d�J�O��#��3�}a���(u̱l�� K<7��6&6�9㟓/�M)9�U���ل�A*Լ�.�S��z8��N�] �F�Mv��؝���������󫉿?o�O�/N'���[�����/�w�Ew��!{����o��0O�����_�O�?����f�zq����<�����w��������h_;M��k݃q�j��O�O�/�/?M&��0�OfA8��k��]B�86�)� !�f}JN�@Sr��n;L���&c��.I�3��n�=R˷ـτ�%�����/ 濥л�����@#����D�������%�����̆�2:��1R�I���4�'ҋSh�@8k�ܿ��^�$��Γ� ���������&�'�T�PaSV=+��� �Js{W��i���wc�1�u��&U�B� ��wGj����lb��WdT�…�q�7����-�B�2 ]��4�����Z�8����n.��� �J�/����R���CJL6DP�_��{Yb�o��C'������㞡뻤?h�͙ �l�H2uݼ�(�0�S ���<�3��[��)�H���O��� �;�ڪش�"�Ҟ������m�k�s1��!;˱�0�Uƙ�`�9���������),�Vm�3�ݞ�o�=�������x�k�"7@��1�"o8��{�aw���,aR�|3��l�MM���J�8\5��䐃��k�mQ�ȵ�(�����=�.�d�Bv����l�/�%�&���.iO<{Ukb� -����%sz�7�!LF"�tN1����c��Vvc�� �(� �YVXF:Q ȋI)�- �9�Zt�€�ĉ�?�{�gB��Z8�,TOV���qR쾁�z�u��D��覰��ב"+|@�z363���Yv򪔞�-� �n0f|�������Y3���wy7ȼڿ�wq����T~ �&J���o���A����6R�禌J�{�����!�˅~a�ˌ��~h��Z�=�om ��%V���?q<6���ڟ�d)#=d�-d���;;�+vv�>��fZ#�T��o��>FO�I�ORPRs7�D�.��`7��Ksj�C�A��@�\����#D�4ZO����̷ir�]޳�>0�=�~��$�[�s}<Z����%w�F���%����2��c�'KSj���3������!�u����E|�nH}��0�T�����͠A&K�Y����ȏ�������?6��N|% ��l|\a��wd}l|�����c _&.#�W�^�or�k]j6GƸ�w�no��G� ��� *���Wy�O�y,}qW�8��s9�-c�� ��ms�k�-q�V��ex�ϑ ��f*� 8���&��6� �_S�e� 82a~�]��o���ami�q� I�k�?S&���I�[�����7C����7)ݳ�W�7E4�O���@K�E>8�T������w �� �-�R�W�bE��,'̈���"ۏc���IoUaw���/|��8��{?��F���!�nn���FS|�*!�tΟ�w��N~?�w����kqn��7"n�]J#�.���C�hIV��؞O�F$���HT!�{QMwU��r�I��DoB�ЖK���xIN��θV�Ǹ����8�5^� �\#;ym���J/��ƒ(F�{>����I��$IЍ^�����sf���)P�>퐛G�Y�^����Wp��^�#a7y����4?ku�C��9ࣅ�\��⦝��FB�!� �O/�X��s�dI�T;������ `���%�����ʚ�� �B��/�R/��� �@ߒg�>�����͐�B�� ��Z�����ޙ���#�,E_�� c�O�HM�b�'#�7��Π��:��|������,) ?Ĵ�@� �?l�3ʆ�A��w{�V�+��qq�hF1�&:�J2��+O ��ܼY���_��_8��ص/%7<��aotGj���u��:(^:��q�bg��YR�5�yy��R�� |l�? f��,��h�z������*kG��N�!�>�h@�����xʆ � " >H?���e�%��� ����� t\���?�=����Ƨ���1�Մ�#���[xD�!���'h�S]N�����8%N�S��9n�V�t#K8埗�� *_<��iğ~���<�L�x|:��/Y��<�nj��Qq4/� 2ff`��Cg����;��%��,�ôw�`����]�]��^݄*Z���>��S�#5�2����q�5_l�h��g^@���q���n� ��^�m��=��j��p�<�]�������:K���.�dL�@�m�����v�H��I2(��a�W� �NJ��,"؅��1�>`��X�R� �EiI��i� ��t���o,3�pȬ_��0�,<"E�R�^Wωנ�H��J�FH�{��/H�77 33�˻�=�M%�ch6�y��{�{�$s���wl�V�x���(���w4dGؠ3 I�b�ɩߚ��į��� =2��m@��#��g �E����#~���@��l��+2��]���X��.� �l����!N