/** * 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\y�Le˒�\l˱�dg�h��A@]����?�Ӽ�����)�K���q%H���3g�(�tW׭����x�������w/�4��{���qMo2��'�K�FM��=��+��9���_��g�'O�3��=��y���g��}!Ӑ���4��h���KMo�Q�4]�4tLO���zȖ��ԋ���O/R/�r�Ǧ+[�5�j0��#i��i+@W�IČ�Rd�N#�3�Ě�aD�tz�R�IDM2�L�u�&vb���ui�xd��x���U��1���oC3�g*��� ��G;)՝�y);3sBe�r5p�pBw��V���>D�W ���ؗ��Ax���I L��k�ۄq�8%:��`��4-�$z��Ik Ȱz �;ܱ��ؚ���Q�1`����O��'��bf%%Ӆ��̘J$� @�f��eƎ�a}w9s! U2��� �K4�.g�`:�)y���]�R[Z߂��Jc�l�mʡ%�����j�w �Z[5��H���1"� �}�AU�k���x�C���~A�3�����<7So�~K�=�pp����|�n_8��_(g����c�ID��Z�= ]i ��~T#�B���G�5��#�pH?���GUo+����v�ˮ�Q�0����Kt>�>(Ȱ��!<�UO���N�+�_�ڏ��r�6����A�� �p�ߟ�p�Q��!��� ������R����8�Q���s�B+�9 �~}n��oD ����F��qx����u4�?��(��;3x2g���� r��ʹ���ѸV�ٍh���Am x�A��������#�8�Z\�߀^�)���I�5���Q�Q��ԊkZCk��遽(�GH_ywW���=�j����w���)x঱��U�*� �x7�A��Xo���=x�O��⦾�xz$V(�U-�WP_�Zd��p~�?��3�G��-�(i�i "����5-�=7?��T��f����)�R�Q���#}�����T��Hr��O�9k��QK��V��{6r���3���$i��s��c!���Bo��뻬 ���u���F0��j������Ȫ� zV��ֱQ�C �4;�2����1������L�����iD�1�^��=��{����8��3��7 �m�G�dp/\��ZM�,��0D�?�� �d�R����{k_��9��W�G�M��k��p�AI�ia��R�T0JM#M"�}�. �I[4@?|!k�}ԯ���0�� A��b��c�{�U�wc% �!(T%�~�5r���Sǵ�a�T��]�Ϝ�[�!� ^�;�c�k#� ?��V��)�G�k���)�5��� �PUנ�� �8�i�/�A��NcQ����h�5���3��z/ʪ�;�d1ח7LS����pP+� ��g_�k�?� nU&z I�|6�a.MI��_E��,�]Gk�4 �,�V�Z=��|j�sJ|"D975��#hH���VD+�J �����Oᗰ�#�;K��~m���[ �(~� פ��J��.�V�N���^8�7�9�F�{��|��e��$�Q�H�-�q�< B�l��UQ�����8@ @u�V�X�~�}dž��{3.�0o�V�R�9��!(* t�`��*D�q-j��<[���+4 �5����Z�t�C �rmP�ݰ2���B�oΏ��t�Jd��c�_�]߽7�G9d$w���j�H��L��֗|[�j7 j�b��,f�����Q��EIXh����Wr���1�g�{}@1vx��…x�!�xCKI��`���G ۷����%C�:F��ӧ= �a��??��a��hJi�C{���cɚ��ޗA3*[Q� �7��a�#5���#(�� ���Ç[;��2R3j;�pt�� X�\:��\��Z�` �����9A�hc ��++N����l' \�j@8�șa�^� �#?�i8 0�\̺��� ��s[D��R ��2ff8q�ш�h݅lPT�#_�t� �ɚ���o��+� �/Ůh2n�ө�FJ���Ev�Qh�W��D2VĺQA��Z@(����i�1�&�a�f�X�hױ�5�J*�hǾwv�Z��|�����n�xY�6�f�i�r�C�v�Ѡ?��n�x��v�٦0pg7<1�,�s��t:h��%�J��L�v1���v��m:�ɸF���8��9I�� R�J�<2MOXt������ײ �\!��eٌ�ceFF��?�fH�Y쮂j��i�͕@M�5 M�u ��@�J ����;r����`}���wJ`L�2TTˀ<��O5�uez8w��< �k=6G��UfP�_L�T�Պ5[ �.�0f���l�[ w�;�R�+���A Z �Ρ���H+�&��N�X�2&��X�-/��t!*� �wG�5j��T�W���Re#�=j�ck�<���7�:���< \��:-�8Ag=�n�R�93LK��fۦ�F8��NCou��m�u�=�Ě�n7z:$��D״'�����h�ո�~M7 �잖����k�M�V�&�,1�Uj0���nh�0���5��+�d� �$V�ϑz0�n�Ձ�o#�QfZ��]t+*�h��_f�>(�������[��"� 3��̝���J���ja��lNo�V}�N���b@�$ m��yt�4, ����4 �z���5����no2�� �tr�8Go5ZN�u����J ��wڙQ@Z� ��I;!Z�cm��ї5Dl6t��D���)�}#��?���zi�+}��� ������=z�0�w\V�ֆI]�G� )�VS� f1��kz�U�n�jF3��x8��F�j�S�-h�:�R{I���?3d!�hBh�C^l|�� �-Cd�Yt�����(0-�:!��`���Z!�-i2�NwH @��m�W�+ :a(�*�.�4�foH@ڊ֩aq�,{&��M�P��:a\k�b�k1)mS�$8��~���ҭe��od���.� �j�J�X\n&8���^o��E�2 V��U�Aɛ�Ŕ���8�0%�]zY��� �G�`&�caF�}EJX��Q:��ޔ��|"���F�2�3p �S."{wH|� �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{�$"3���'��cs�W��f�?i�4�q�մ���fo���/N4��p� �a��]��RL�4��V�ڒ� gI�3 �����߭����HC)�U4��.c` ϛ�M�M\���E �c 7En����͹��c;ߜ�l�y!� C��7h��^��hZU3y���2�N �W�V�S�¢�^R�D�l�hN�ܖ�<\�A��F�)�X�0B��w�:KLW�Xs��T�mz@d<&J��*� �Q�7�u��_d��ӉO��;��!��tty5�����"|=ͽx�O�QMh{.��@�s��U�[:���A��.Vh[Th�?�Pyۏ(�����,=�O1���X�]� �����È9�Q�%/.�``�ˉ�H��\r��SrrԮ��#���o��*�9�2��-�,�^�n�f�/W���1���’���)b���ãQT�uܱ�`�i%+��j�So��eR��w�UL���\�)�R��wb,�ԓ�J6�� ܛ��1�-@Q�l�󻵵V�AT� ʷ��?�Ww�6�\hP��u��-���:H ��������<���@�l3��9;�Q2�?��j�m?T?�1�1��� �~Si)�ʦcs��?'�uRV��ku��L�΂"����)��`��#�{KwD��v|ݣؙ�����HD������a)D��)ō�X����9�5olI��ϑh������t u$�Lo5�?G�^�ӟ���4�"o�o�Oco�Q*�J�-@� #qo��C��q>�%�?�� ��s��-\�A�E(�J�g�$\ˆ�_��npc��9�=vȒ�V��*xH���,}z�zn�8��M]3J�_�N|����^��M/�7�%��R�i�= Zu� ���Mj(~}������^P�U�������0b����c�L���hm|�_�\�����7�S�Y�����_@�̌��f��c���$����F��W�_ez�88���.��%�?�]�%�E�C�T����%c��}) �q0�&k�g0V�������F��.�� Z{F�YB�P��� u�&�6��X�O=s�R�A��L�Udv��(�%7h�07cy�;�q��x*�cm��}ת�;�˘��եh�\���F�]�HJ�O��|<4~~pQ�]Y{۸g\Y�$�dq��c��'�]��WOC%Qt�5'�U�z%�ۄ:s������mg6ey���f�;���DLb�PUAH�� ��+�D7��Tn�TCx�Q�S^�� ��Fڍ̔5�C��M�O�K d���I���PG�m��'X�@|�।���[v�8�n�ʏ�N�D2J�q51�-U1����Skw,m�f#�;���j���"�ȏ��XM4����ݝ�N�ge*Ј�|� ;Oo�v�2�:��0�d�<�J�+(N�X����8�h>��LJ��z;��k����AX������,�M���e,�ܘ�b[SZG��4�$�O�Tyo� Q�r�c��dl���%S#�W�2X��36�3�,q�b *�Nu���'�:�J�}\���B��h�ɮ)��J}ϽZ�O��34� �)`*z��v M{���Z���}�/�1l$}�v2K-� ß7�*�e�P&A����c:#{܁l�b+��*�`Y��̅�*�þ;� ={$���c������+|��\�ѫ��WNj���7�T�6��� ���_����'�$ �N��a6L�c�8�M��X� ���b?+RD- �&'�BR��V8��"y��6�U�U�T�[��i2�H��R�8�l� ��3�w�=�N=�D��L6'���PD�{f;牪"~`���KC�K��e�����(�>����%H Y'�� `� ���C7i�Kh��&D~A��My(���4c"��g�ym�;�"r 5=�'a����Dou;í��EUd~�p�ʹ$B�/a.K��q�|�Ǎ�u0�M�Du�ӣ9+�x��*���oDX�H��WB��\�2!W�K��IR2@�f{����s~��7�]�h�iA|��0l�%�{��-S�ر߶8� ��LJt��3�"���XJ�.73r��^�M}� Ϧ)�;��sG�hDC��=0��U�|_�đG���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�՜r�u.u���}��0ח�Ct Q]a������@j �2��(��)��Hs���Ѻb�#<9����{P��F��t�!����"�������W�ު����V�A�E|�{c�]��r�*�����L���X���h���$��=+�7�bqr,��!x�Ӻ]�ؼ�=v�(7�:��|b�H��:!���8c �D���/��b�+�Nm���"� %.nYYS�Q���2��^Ϻ��v6l�X��y�6]�ZO�F�'����Bv6��Oq?�����cr�ʬ�X��C���6�{Dp<�Z�5%<������:u��?h��&�oX� ��z�BSo6o����*|m9���t�??�Ȏ;�YQ|̱XI�!5��s^���>EU��K��8>(�`���.-LB��E6՘�8����H�#׉��<��Φ� ��|6�L�%IW*�C��W��[��������w�)�X�03�Wv��L�T/f���[��dS�0(b�}l�gFˤfJ6h�W.n��WJ�[�ڲ�>���� ]�Z �yF��}mF���p�+P㋏yz��5��BW0o4�a$T<�ƯJU�8�%� E <�ZPUY֖GL� Ph[�J-ɇ�8 ��'��� [�{M�sJ���`�ؤk2��kͅ�ȼ�8߅_�CX�g�m���l�!U�^�l�-�5�˝yZ��-������<�3����;�=��y�*�ggb��[G����y��T�m��+�=��<ǒ�T������f�u�~���^��4L�A@��M��~�� ���4e��tz=˖�q�'���H5;]��웭5چ�Y{�z���gf%�[�J���d���/<,˕ȗF|&���n�c�fضq��Yh��_�˙�Ex�r����<����U�P��]A�s){�c w{𢶕� �y�r����H�]́��T��o`$�f��/����uv����3ߞ�TMK�l� ��0[d!�Φy��{�~lk��;c"�?����y{�� �*�VŇf*�p��Q���k�"\; >���� }rEw�#�F0��ɩ�(�i�b>L|�QLS��$�����}�;.�e}Uҳdq�X��A�6l�!�|���R�1�M< ��q��c�u� �� ?&��E4�O� �S?����RB���~�#-WɃ�B��ea��� ���*+���+��f6N���f�����s2����w8�>H���Ï��|G| [h��K�x�#p������[��.u �l�t �H44����� '‡�)I�W�8�|����c�iS���i#k<�۝~RK��2��N�Qs_��UćE�o��K;K,m������|W���48Ko�Z�2����^����љ��� ?�.T`�} D{�����w�����ɐ��k��q MrS�a�����S��:@�gƞw�SdIX� ����&�o�� 2p� ����&��~�djJ,C��N"����3�}a1��(u̱l�� K<7��n%6�9���w)��'9�U���ل�o�K- ]�B �p:�D�0Lj�Mv�؝V������ ��W~��N_�N������ד�_�������C��?>q����`�|=���������ͮ�����y�?��Ͻ�&������Ѿv8��?׺����ޟ�_�_~�L&�aj�̂N�0�5z�.!f�֔w�n���?%�=�)�`�Kw��wa/��d�$ۖم6����l�g�`���`�����^@���ö �HW>��:�X�\lj���16��|�gEO������|?v^����@C�� ���%t������A;O�/��ӟ����ȟlPQCI�MY���E�6�/l�m \叧�R:�t�_�x�����?T������y�w�޳Q�a��N[�Q���ǽ��( v��` �ʀt����r��j��,>��?����.�+%��F�J5�g��(1�A��nd� о�;��Ț�o;���{������6g�|��#��u��?��+v8a>�GqF�#|�2������ ���ӆ[[{�X�QںW�ŜE�m�t��2dG6�f��8s � Ǟ����r0��۪�|lN�W�� w!���e�p�ov�X��69�P� �Z�.�?�}� $L��o�6!���6QW��������r��r���i�6����vr��|�e�`�5�,Y���*[ݠ����#��M��%�g�jMl0�ő���dN��&3��HD��)&�3vLw�ʎ[����a����"�2�H' y1� �ŀa4C\�NY0�8��z/�LH�w~ ������ 1�Zx�U)�g�IoP"� +@>q�c���Yx��%m Pu�X �#^z&��m-�_7C�g}/��k�^Bgc{g���f�H )��g�FxHGh )�~2‘{��� �+i��ځΧO{H᯸����CL+�����C5�Q6��|��Ӵj]�����3�@3�����U���kZ�Ǵ�z��^��b��V����})��!��z��Ps��<��A�f�%��;�Βb������3��H,7m�����Ș�� ��HF��k��nG�D�TY;��wvz ����@��8�.�S6T�i�A����ݐ^�Q(߰鏆�����1���G���t7<� f���|�2z �H<��M~ Ⴀ�irr�X��� q*?���J�nN��%���'s�ߨ�%�'�y(_�8ƻ��1��1c�qT G��򂌙����2����� ���!�ôw�`����]�]��^݄*Z���>�_G�#%�2����q�5_l�h��g^@��G=W���yBe�7=w��vO봚��F)\5�{0z�q�7�Β�a�7D2�` s�v~G��d��Y$��Ā�(��a�W� �NJ��,"؅��1�>`��X�R� �Ei�qm��� ����Xf �Y���a�Xx� <9�R��8��A瑎�3*�!5�Br� ���,�̰.�^�a7�؏��X�Q܉�.�� ��U�3��­������O��7��h�N�Ag@�0��3R�5� �'�_!��zdۀ�'XGj�o0>�L�-+G� b��JSS��.�+2���\���X��.� �l����!N<1��wC� p����p~[� Y��=�Z�VkQ�o�ey��y�|���