/** * 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�HQ޲d;�r,)�޶��$l@P�h���y:o��}�|ɩ�n�H�"%%3s�( tW׭�����t|rt��� 2�����>~��=�z����iԴ��~�\z����k�>�;�2��pw���f����]��JF!��QQ�V�]jz'�� �Q��1=��ǵi�X�S/��d�xQmZWb?6]�2���~�KTC��o�*�U�D1��Y�����&�FfѸ'���Tv%RK2,-N��{���^ŵ/楙z�ڷd��ǣ�óÏ������l�^L:��8�4�o����fD�CW�?�>�"u����S�5���dH?�X�O5��jj�S�m\��O5I��(��^�����AA� �_p����>T1�:�4v�V���J?��u<˝�H�K�����¡>��a���UC��� ������R��u�!�hب�G��g��V٫^_�!��H��$�XZ���ˋ{��$@�{F�8�P9v��d��NţSr ����N�ɠR��F4��i쇠6<� |ŗ<=y�F����`V���Ћ5Br77)��4�5�Z j��ZqE�5�M�E�?}��Y@j� ���V�r��s�u�0 �Y��C� �x7�A��X��^�[f��HK����Gz�Q�=0s�ui>�#�T�>}4�Y>� >�V;�l䞛�gZߞ�����ϥ )ͅz; ]��*N��ANR��V���ޗJ��"�z#0�Y��Z�F�$��t�xЫ<�G���|��+������ӈ����{V)�3����8��3� �12�0Վ�B28�.�n�"qK���� ���0Ȃ�!�$_O������eH��;�<�n��߫�*�=%Ag�݇H��b�ӓZ�F�DL��A]@t��h�~�B�\��^���^\1e A��b��c�{�UU���V���?�dGŀ[�p�z���qmhX7ej~�c'�V|e������H���G�"ea�eO�8�]�6�� �H��^\Y4�_BAT�L�� *pTӶ_\�\��(��"��9�Q�k�فg��5�^�U� w^ �b�/���d��1�`�_���I���T$��ܪ�K���ɸO�\��v?����g?�]Kk�j�Y@��;�jj+��\��ĉ��T���!!�K[-ɛk(�@��_?} ��N�,� �9��j�n)�� (4\����ʺ�J�; >���QU��`� ��Y��;^,�B%I��ʑdZ�|�-��ys~F��[V"k����9����=�A � )��Ƴ�#�B|<2]�oZ_�m=��,�5�EJ��і3���9�P�������?�ͫ���Y��Y�^�PU��>�0��oh))T,�U*|�!۾5A�_�� E�q�ϟ0���:3��xj��ߣ��q�ގ?�A$k#x_e��bEQ2��l��jy�|�@�l`PW�>��am��S�1{;�S>?��0��1�F ��r�loo���0֘�_Yqr���e;Q����H�#g�lzqr�~hӰC`���u�D#�]�-殈N�s9,X.�����:D#����AQ1�x�u��h�"4�a��-�*���b�Qȸ�N�pV(����W�u���67�d��uS�ǵBa8dLL��71�5#���F����1US���8��� �ҵ�~�y< ����Z7�����&����L���Wݜ�`-u�Ŧ0pg4<1�,�s���Zh���%�j�^OӺb��9]Ս&�d\�d��뜍$L�)c%o���,�^Kŝ���kE�pN�ڊbF�� #�(�o3��,���J�C��J����z�q ��@�J ����[��ݪ����٫�90�{* ��Ck�ƚ�N�h� C�Z��~ךgP�OGN *�jŚ-� L�*3µwm�]w�\:�R�+���A Z�N����H+򆜇��2��ʘJc���zW���L+���V����8 P��y�+%Q6r�Km}`���Z{u��N8t0 A��M���8Dg=�n�R�93LKT�zӦC9��JK�m�0ڲ^%�L��ͦ��Cb�JtM{R]Jz^����ӯ�t`�����5��ve���J��$��%�J F���������čX�$3m�&��~��Ѓ���F ��F�̴*��]t+*�������Z{�����5o#o���4�f8V�; '�� �����ٜ.�V�^�y `ŀ I0�hp�h%iX����i@��+�oU� ���w{�aUeh-������9" x��rj��7'W�P@,��̌�M�W%̈́8hI�[��6jO��k�X�u��D��C������]l���f�ҷ�-ހ�m0��]��'C���n��ڽ�aR�B=H����5�Y�n䚁^g�����ر=ί�!�V�����\R{i���Y�!�.����bK�ٴV]%` c, L �N~4&��FH��@� ��^�}E~��� �@�� � u���d@���*aq��x&��M�P�u�<�&�O5�k1)mS�$8��>�ZI�Ʋ��岲K)ø��.W� ly$�Ыr X��/�`�0H^����LG4�Չ��f��2p�U�zhh$0)���]������a�NG��ֽ���e"�����܂픆 �������v.����{��1�� �0a9�D�t(q�d�E�z2�ZZQ$���"8�����sL�i��ܨl�hRV����V��ɥV��r����c>�Y�|��l�&:[�#$��'�/��F�k�J�Kp�����--{; �߉+ZFa~��&��bKu�1��b�,"�m`i���n�v��R�<�)/R�����I��Y���!����۽�}���K�Cassj��;Hxmot/�w�Q���M<׽Msv���r�'u�����y��A|������| w�k��;`��O������\߇݅�]|ם�j#�uWS��W�Y��}ԝI,�M�,dsZ�;̯��]{1b;,YC�K�X�=.[]���PZ�W����e6v������v�e}h�RŽ�(�X�/2܋�"��4������Ze����0憘��y��p/2��U�{�)�*���܋J��?[7�&���- %����eK w@� ���3�!+W������pn�gM�.�S�������u��1�J��Og3�lO�}Mmu��f��ȱ|/�ﮰ�]��-g��8dQ��D"b60ǎ;�6c�I���iO����=}��w�wضh~u�1X�Ա���2nۻ����i�ۭ���( ��X�Cכ�~c�[ �� T��R��h���.c` ϕ�M�u\���E �c 7En����͉��c;ߜ��&D�BR�(}o(�0+� �liZY3y���U��K'�ث�L+v.�`a�_/��j"i�w4'{n�h.� HvF%�)�X�0B��w�:KLW�Xs�f*�6�! �J4��_��9��ƴN��K����)�������񰱏O'W�!D֧���y��|:�jB�s��{�^RܮJ�� ��������X�MQ���T\C�Il?���*����>ŜFcc�vY*�.�F#欦�-yq�;g�XN<#�O r�ԉG�l �f��ģd�[�Jl��֘��L��/r7�Y����au��|paI�r�0XK����(��:�XX0[�4���j�U�q�2)��[�2��ׂ�.֔x�m�;1�:ד5�lL�.�7c3c�[�� �*2�wkk��/���o��~�2��m>���3�(��k�� � n.�-v���,z[�����P���:D��ҭ�5H����� ��T�]���jC�{�l:0'n��q�_'e)��FP׉��,(�XAY��v�<���t� �'��C��������D""��� K!�k�H)n|�bխϙ�y#K��D�O@:0�K�#�g*x���%�r��|��_�qyk��&��4�V���D�Ī0�& �:� �3-1��s��u~)����#� h�%\���! �0���c�6�)����dɝ*��<�Zv� ���iP�4j8����>G������(���.�����x�P2 ,5�Ѫ�d8v�ŸOmRA����Χu5��50�{z6 �+��'�K�� d�E/���Q�Q��%׽@�������TT�0@i�-D��?�q��HQd�(7�`�7�w���%�U�c�^�7��d� �n���s�n�{���U��6�d@qs/��5�h��{c��_���l�uI$N��X3�.�R/��ȷ�s4 W&<�`�=�̾Km��ۅ�(�^�@�'7c�7_y��8ً;^ƕlT�S�u �I��߹9=�=�����C�|������F�AX������,�M���e,�ܘ�b[SZG�ʒ4�$�O����-ޖ�`�eR� ��"���Zc�����9��%]�1�`�KN�����PL�?��aYZ��2&_����<�5E]�ﹳ��4�-C3�П��'Lo�д'���U�n+� ��1�����Nf��wa���V�q�7̓ �q��q �1��@��� ��A�C�,K� �BG��aߝ��) y�����i��>)�A.�������� x���j�rvp�ݿ��wJ�“yI�A�ǿ� �pl��I:��v6Y�gE��e�۔�WH*#{� '�~����J���Jr��8M�Y�W'�a��sAx� �cO�SO6��$��A�J�� ��m�2QU�(��viy�X�l��>�w��B�S���A�"��A���b�\�&�r��~̈́�/�'oS :88͘�'�A^�����B�AOE� ��L�~ z�����\TE�׭�K!ta��cek;�TDEJ��2�����q3O+�dO���Q�E����D���TM����� S��W��լ��6� }����{ZM�;�/�$�q��S��)qb6�)t�v��8�WXsu-���E�����+�y���˖Ƣٸﳕ�o�}��D71���{��Y��.�+̕�\�_`�F�%��|�!�(%-r���!a�$%�o���>�W=�w�|S�E���7Y����F_��?~����?E�l����ܡ���2:}U��_>z��۷Wǻ�����{l^G���/�?�Ҽ�W��S��}�ӫɫ���^������9�^����Ͽ8w5�w6l��'�0�{���w/~u���?~�����/��O�/�?G��# �p��Ǿ����ߏg��L{O��T=W��|�Hh �,uǡ��s����B2���o$6� =�N�'���j���rߚ�ΐE~bn��c��B��h����S��X�0�b� ���(�+���0�p+�G�Y r�O� ~�@w�K���+b߬;��e�C@W�%⬦t�=������Em/ gh�C ��6�����I��X�OΣuDk�>�h�n#��|:Đ��b�[WD~E������sQtiw��m$�%�Qh�vM���ת���Vd{3�B�C�taDtk ��O��T_C�F�q��y�{�x�(7�:��|b�H�GmB�p�b�p]�_B1��;Vl��n<��EtJ\ܢ���G��e��7��u?l�mm�l�N���)m�v��A��O �%d�a�lm&$nm��o}?`r�ʬ�X��C���6�"����5%<���{��l�:��=h��&�oX� G��z�B]��o����J|�|:CW>���~��oX����c���Cj���ϻ}�jnr/*��`+ �Hvia��,����� �>�DJ0�N4"���,��M�}�t\�t���'� ƾ��R-�����LGx �sI�^���@��3J��Fz1cż݊��PaA�`;c:Ob\�`�n�qU�f|E����TMW�ڙ�uFG��fG�N�Gӛ��`]� ���И���p++P�ˍy���54��U"o4�a$j�`ͽ&�q���$�-�k3eeY�Y#y6�~�5��2�$?���H�5~ �1_�����Լ��L~���^M&r����g��7��p���Mcۡ �Yk��V����d;�0��))�'�q�2�Ό�ؤ�2Ϲ��� t26��}gB�$��xX�.􇐚��1�<�M��[ �9��?� �N��4�]1��WR{䚮�O�x,���m��w�T��t�A'�������8+�1H�Vͺd8 }��$p,\Ǫ��.��>�^���h�0�]��i\<�+~���t��W$RsƊU�d3G�G�gfŷ������oGV��X��%[�Ɠ�8�U�MHqˀ�G��ڃ����j�zQ�8qA{Zg�[��۫i���P��W�=�p�/j[i�Z&+g[5���tU����д����HJ�M;��2����pk��^m�����R5�o�q��Y|g�&��u��l��Ë���v�����/��`*zw�=9���5a��( F,�O˯j:�_�;x�F0�u\�A�;�w�w1J��."���p��¼w�`g�Û�-�0N\t 1����pT���� �Y^���c"�;xZ;&��|t b�ޖ���N�+m�������"�j��s$Br��RmT����ds��#�~�<���o��!��!�u�DϿ4]Ý��% �Y��̀B�M�� K���bD�G�eL� �hJ-���g����Ŏ���ZO',=����N���RZ^:�6 4�WP" J�� ��1�Ř9���{�� + �`�V_s��Ğ����]@�S��?�'��+�zC�][ͦ�Y� O���C�i1����ӯ-�����~���-��'��_= ,����ZAE�>8 \D0�ʆ�@��%21C*�$�^0��H���H�p���j�t�|ؠ������q� � ,Ю)1�s�_i�e�`���=rY��-u�$)��J-����&�����S�E������r񜌊ū��U���PK��'�����k�B;l ���cG����v�k d{��P�4AC�x��s�D��<%�S�*}/���_ڔ�3�~���l7����:�����M���0�2�����o �+�H,����=���|W���(�Ho�Z�2����^���/х����\��0��.�M'?�?Y(Z��~�+$CR��=�!��Ob 9 �$� I~��R(�pr|���p$C�c/�%L��l;d�� � 8c����Y�,�X�%�M7b+ og��º�;Q�c�`;�xn�s{���f�����M#�j?�3&���V���+4�]u�Z� ���Э�������T����?���������� |����g�>|�>�r̞���g����ͳ�����/�������m��b�o~���Ͻ�������P;��k��A�j����ϛ/¯?��^/�OfA8�� ���kbƱi�x v֗�t� �y�ǥ��軰�V{�%�_v� �Gj�6�0ж��i���qM�+�!�����t �����\�=��`��);�4���-. ��m0f|�����`Ƭz�+�����d^����l��G3�߀�����[���x�Fln�H�.�yT��+�3��ĵ��~e��a����%ٵ(����DKK�Q]�xl��?$��U��&�y��{�_1�3w�������L+$�� U���c'פ�/)(��f"v�z��eN٥1r��j'Wx�T.C�h���N�'��XZ~��4��.��Y ����x���έܹ>�Ȝ����%��F�� "鐏���2���g-Sjم�3���}�����E|�oH�{S�*?3�o���"�t����|��ה��|~��V(q�c�9u���s$sw|ⵃ��:�+��0 ���)@��K㭡$=��?1�J��%]��*]�Ⱥ��� 9���c���2v�;؍ �(~٤��dn���;���>�3z\L� ���ys�#��\����� s-!Rd�g��c,X�%�s��M����zĻ��\����Cv�[�\��E�)~���x�/��K۵o����GLJg���K3$}��������� l���q�B�H�,E_����HM�b��"�����?I�t>>@ �%zB?1����k�Յ(vQ��]M+���pz�8K4�o2Β�?����ޑ%�����'3�����.�ܓ����U��Ϙ+�p+��^/i�؅(v�c���b^]��@G�� 0m��S�})�ɂY⫳ɨ7v}���!��y;��wq~ ����@��8���Q$u�%���:%�9�^�~(߰��,��wL�q�Q����j��S�lF �O�S�Oo!��ɞM�34�� �.���qbyR�'ĩp�7G+}��%�n�K�g`�/�&4�O�R�K��F�P<� �p�(�1��)c�qT G��򂌙1����12t���d�;~��;L{�i����_���z���&T� �K�~k"�t����^.�)�|�%�ٸ��OP잨]�+��[)Be�ж�{�]�ը�z�p�<LP ����E5�tY$c 2'lGmԻNv�^D"�H H�AQ.[.��:�B\�fA��k������b�KE*��%�ڦ1.�\�N|sS����!�z]��4����xrH�jUu<'^��#�1*�!5�gAr� ����Fż�Y�w�;z�J���l,�(�pfw� ��I�*l��7��6�x��- ���w4dj�3 I�b���_�� �#į��� =2���C�[}����"Sx� ��fXp�����V�����L�!\V� ���x�e�o�_�X��)n�ŝ�!^Z�\o�o��j1}�荎��i6��f[Q���#�