/** * 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���^]�O�Rg2�zpy�L���\��B�!�i�@U}���� �8i4��i蘞b�3�"�-ߋ���;�8^�^4�؏MW�LkJ�`>R?G*�t}�V���9�� �� � Fg46�55È�C���ܓ��dx��s�^~KD�J�O�6=w,*��q<'v�|d�.�M�� ����������ܳͫ9�bDCb4���3���I��ȏ�����̼���9�2��f8�;Hl+S���j"�O š�ؗ��Ax���I L��k�ۄJq�8=:��`��4-�$z��I+ Ȱ� �;ܱ��ؚ����Q�1`����O�'�cf%%Ӆ��̘J$� @�f��eƎ�a}w9s! U2����K��.g �`:�)y���]�R[Z߈��Jc�l�mʡ%�����c�w� �Z_5��HБ��1:���Ȇ�+��L��@H���������e�~6���s�ߒg�>�� ߪ��g���E@g�g��@d�!��FfDOCW^?��H�P�p�Qe�9�Uҏ*+�Q�ۊ�4?�]�k|T�� @y%�&��O� 2l��GO�� Pip-�7b� ��k�#:cdzܹ�t?G,�a���(/����4v��bH77���G�d�Dd츔�_tK�z4l���ܳМkNë_��!�Q��&�Ī��u^��xx���'4��m�� ��Y0�y��rn�sz4��ov#E��8�CP���� |�o�t|�V��#N��U-��o@/���ܤ��@֨b���{j�5��5����^�;����CH�@��b��\��\q��C�F� ��u ���Vl�7�a�xTDk���sS*gq$9��ӧ�ʜ������o���=��v�V�wK��R�9�R����^H�����]V�I�:�Ij#��I�?�GRE�Hd�o=��qR��(¡~����GC������_h���G�{l�}�4���0h�U �=���x ^�R�j �9���@28�.�έ&qK�� s��`�C2l�q}m�=��/C���ݫ�#�����5SA��$跰���a* �����!�>xPݤ�����5�>����i��� �LO1�sDZ���껱�����?�������샩��аn���.�gNʭ��/��1���Ԉ�x�l����ኣ�5k��ʀ��ۋK��K(��kP��ł Ŵ�� �k'����I�GoxX��{��s �e�pÝ������)Y�A���8��z�I�3�/s�5�}�* =��$o>�0"����询�y������z�hP+�N���J>5�9%>��c�4$�yi+�y��R t���ӧ�KX��%VA?��X��-~�E��k�wc%��Y�[�'A‡R/��L#Ƚ|R>��W ��PI�r$Y�ԸF �� 6o䪨U�R �k� ���y+H�?k��cC����i��a�� ���A��[��\"�5�����S���k����g ��!�_�6�d�nX���i�|�7�G`�h�U%��[�1�/���ߣ2 ��;@o|5|��[����L�K������f�HE3�j����Z�(�k��$,���?��+����ó�>��;<} n�B<�N����Pu� �W��G���9:�zc�P��7��ik�3���v�?�R�����D��0��ePƌ�V%���fiX�Hͣ� �d�������k��Ԍڎ9��� V�1��18�0���3X²�����OP$��X��ʊ����-ۉ׼����J��K�+����t�g�Q�G�o}�]g����&���nTP}� ��!cbl̸�qX��L7�u,d�����>�DZ���-������x��)^�M��mZ�܄�д�y4��Op��3��]�F�) �� OL* �ܪ)���w��:aI��l6Ӵ] 1�����F��n2�Q��3��u�F&s�T��7�L�]���A���,C8icmY6��X����菹Rh���Zrs@Zjs%PSn HSm�d ���@r�-����;j%X���ӽ �2 �5�S c]�Νh*OB�Z��Ѩg��S'�b�b�V��K���=��VÝ;�-���cklP�Vùsh��<��� ��_&V����4�Fˋ�w@�ʴ�ݑm�ګ�/��U�m$��D��}����Z�;�u�M��N8t0A���N�2N�Y@Ϲ�[�TD�m� �5�ٶ�NFf���[݆atz�hO0���ۍ���:�5�I})鲆3�y5.�_� �����䵆��zS��z�I K�k���<�Z�Ll7tM$n� '�i�5���s�� ��hu��m�1�L�¼B��N`E%�^C���@� i5�~�6��H�� g2sg�|��`��ZX�9����U߯#��PA+IF[-n�$ ����/M�^�{��@M�%��ۛ �*C�����[��Sc�9����b�vf��jÿ:i'�AKZ�c�m��<����͆����>:�od�;�'z�Zo#�|�o�[���b�3�=��'C��������0����$E�j��,F7r�@o��֍[�h���W�h�V�~�� ^[j/��4^��g�,�M �aȋ���VA�5a�l:��.����Q'? �V+��e M��i��"���J{D �X������H[�: ,�eτѿ ��c�C�N��D�S�r-&�mJ�'wٯ�VQ���4� ��rU٥�a\�Vi����<�����HC_F� a���;(y3��Ґ�'���K/��3@#��H�$t�"�ȷ�H �u:JǷݛr6��/BĂ�w�Y��wn��vJÅBd��V�o�v�����{��1�� �0a9�D�t(q�|�E�z2�ZZQ$���"8�*���sL�i��ިl�hRV�����V��ɹ֖�r�����Ԭ��\�3����V�HIk�I�+p�Q㚸R� \ա�zx+��N�G�w"��VQ(�4��^*�T�c.[fٸl�H -�wS��RK��x#��HF��˓^� �`� �Cdm�p"�{��`_ϗ܇���>���w�����^4���_��x�{��&��������O�6������˃��; _����>�X��mw�|�v*��e�'��� ����;W�F>뮦�����(���;�X�nY0��2w�_����b�:vX��p/��!�n{\��p?7�����/><${�l��5��������Ъ��{�Q��2(/2܋�"��4������Ze����0憘��y��p/2� �U�{�)�����܋J��?[7�&���- �� U��%�; ��l����wyg��U8���&N �ya��,r:w�?�~̶����� <�Ɠn_S:��m��h�X��wWX��.����Ǐ$2�(pX}d�?6g�{5|m����~KӞ]M{�Xk�v�m���D3�� Ǟ��q��ŭ-�H3��nŭ-YN���p��:���Z��J��^�j�4��]E�θ;��2���ش��e-^^��^9�pS��[�/[؜{�y1�����mB!/$Ua����& �� a�M�*`&O|w^cU��܉@!�j ӊ�s*XX��Kj��H���ɞ�2��K6�^���H��2kF�[�b��jk �M���E�]E��9��ƴ���K�l��c:�)9�q���id��.�&Y�^��������<� m�ŗ�{Nq�*yK�R"��#h���� m� ����*Ob�ŖW������)�4C ��R��p�4"x1g5���% 윱c9��}A�K.�xJN.���}�Q2��9Z%6�oUf7�%���Ë��|֬��jX�:S\XҺ��5%^j��N���z�V��4��{363��(���"s~�����"�*�A�^�;B�՝��'�T`fey �v�����?b'�?Ϣ���<� ezΎ�C�L�O��Z�d����a̧ �B��TZJ����؜�q��I�����A]'z���H�aeaJ�:�e����]Q<�B�(vf�Ǯ�`$���(?`X ��_+FJq�#�nE x�t��[�p�s$Z~�rw4�)]BI��q��Vh1B��\�Ƹ�`�-���̌�tAs�� q� �$~V���t˧ݰS��`�+��C �M6��亂���q��oi��c��#�|蟯��Y�&_�H��oj�i����h Z�2ˍ�(F�5�u�k/I�K��D,@�gr��+�I1&�@��+�]25|��s�K:c#?*�,��IUQ������ê����M�8T��v��"����ܫ��4�CC3�П��'L��д'�v��U�n+� ��0��A҇l's�»0�yc��X� e:�;nA0�3���Vљ!��?�r�e Xa�\訒=�s�гG�L?&o�~���'Y��%�:�u���o�LEmCXΎS�[9��O� y2[I"� ���f�9����$��Up�;�,��"EԲ�mr�+$���m���(���m�]%YEM%�Um�&��T�,�ˆ�� �@�����ԓ�Md�8�d3���;E��g�s��*�ǖ��4��D�\6OZ�λx�!샋)Y[���@�eq����Fl�i�?t��n����jB���۔��N3&��{�n��&�C/"�Ps�S�F�A��N�V��1�*�\TE�׭�K!ta��cU+>�TDE*��*�����q3O+�P��ȑǦEG���B�J���Ė��弚e�f�е��l��nK��5U�[��'$�q�ÙMR��)qb6�(t���j���/���Z�})������#J.���=n�Z0��f#���Dx���4` @��'{��\��LTQ�8I��1]���˭R�a�F�%��|�!��-r���!a�$%�o���>N]=�7�|S�E�ƚ�7YÖAYB~��q��25��m���?�ݔI����`�]$��K�� �fFn��K��o���#%~�Qy�[�h�W�������8����_M��π�rDߛA��Ëߢ/F���t|򏟣W������D{~x�j���o���������<������=4�#���ݟ_i��K����{m���j�j���N?���`vJ��ӓ7��˟�����w2i��ZG�0�{���w/~s�O8|��y���������_�~���G�����?:���?L�~x�����)[����*`6�� ��%��8��pn�e�.$s/�� ��s�G� �7�S��C�[�ܙ��O��UvL�Q(��z|J[ ��] 8a���r%�{Z��|d�"g����t�t׹ԩ?˿"�ͺ�\_6�1Dt�Y"�jJ{?�)��\���p�f<�p�n#i�nE�G늵���4ZG�N�AEt��g�!�S���/����_Qz��:��Z��m$�9�Qh�vM���ת���Vdw3�B�Cb����Ȣ�X[���8���ɱ(���N�v�c�����բ�xg���9�q#��8�"��1��¿�b��w��:��zPw��6���qeMAD1����z=�~�v�ٰ�b�B�S�t�j=�}�ZK��� ��LH��>�]!��2��e�+�Ncm�)"��H�����j�֔�h�l�W��a���u�6k�8�am,�� M�ټ]>>����t��z����0#;��fE�1�b%���/�y9�w�Uir/*�����'��0 �f�Tcj��$�#9��\'���#;��&0����3�$]�\ [_)�����������9�xu��� _ܙ&�}S���bo�ϕMu�Ƞ�w_� �-S��٠�w\Ÿ__d(!nY��F�D�Zo�l�Zk�AgL�7���i3�GFW��_�&_��Sͧ���w���y�q#���18U��H��-I�/Z�1ך�ʲv�8z�l0�B;c�UjI�)���H�;���/n���kj�Sb&� +0��`��\�.�M�%��/�t²-l�&p��`����]g3q�+�Ad������mYL��G�(4|g����ID,T!<;���:z�MW�ܗ���5�P C �qՖ:�̦��7luK��u�K}Ew�7��c�>$���@� 2��yNS�����Q��Q�����li2�;�~�9��6]�֚��f)�躊���d���/<,�ɗF|v�����c�fݶq��Yh��_�˙�Exり���<����U�P�7�]A�s){�c w�𢶕� ���r���%�H�]́��^���c$�f��/���u���O �3ߞ�TMK�l� ��0[x!�Φ~��w�� ����{/v�"_����V��ʤ��>Ư�ZN�l��*lg�ZE8%v�(O�/�z�.�G4�`��n�S�c�� C�|�����ƈ�I2;���+�\��x,���:t]IW��}����.�u�����? �Y^�m��D�J��<�#ƽ�}��/�f0��+��~�+�}g�� ��8+���#ŹS�M4�pFL6������ 0���i��V* )9�_�O��s�u0��Y[�A�E�P�A��I2 �C�Rp'.�����Ɉ� ����?����p �-�0�$O',=�Nq��H�,/�}��Q�OP! J�� ���E�B� �=�N�q0�a��9UKb/s�j�.��)�п��ԓy�RoO�R��60KP� �Ur� � F��ȯ/��������-��(����� �ZAEĽ��i���P7� OE�H�Kdb�TI$�`&v�xy!�x����A�&U��6PX�]Sb>p���~�#PWɃ�B��ea��� ���*+���+��f6N���f�ƶ��d6@� ���� i j*?�ƃ���l��36u�������~~�n{�5���%"M��8.��J.���$qJ\���Y��ï�M�:S�g��]ovp�Y�[A?��9Uvrޚ����#>T�~c�\"�Ybi{O���n�&Ϧ�Y�x��–QtU� �}���L%g�ew��ה@t�]<�,~�Q,0?��Ѯ� I?����$�1��Hj�I��X�`8qf�y7=n�D&� ����p��f�� � t���l��oIKf��J5�o6[px;C���߉R������s3,mhbC�3���^y#�؞��Y��əM�B�k�2�0�Gg��9B��ä�d���i5�_����~~5����������d�y _=������>dO��������ɟ'����������ٵ^\2�7?O�������d������9��G���Z�`�Z{��������O��d8L�Y�� f�F��%ČcӚ�"n֗��<4%�q��4�.l7֞�dg3���#�|� �L�[�_��lq��P�� ��]܄ؖ����`"�SǗ�B˒�M �av~f�f�O�Pi�I���>��Ӌ�h�@8i�ܿ��^�$��Γ� ������uuw���5�DؔU�ʍ�l�����ܮ�U�x�*��}��E yoݑ;m�#J��q�a����'zG�=�-n��q!z�{ꍢ`7y �� HW��ͮ!w{��(��������K`��»R� kd��Tc{�o�� ����nB���۸��Љ�9�4y��g��.��ms&�'?�L]7o!��ܽb���ygt9·>)S.�����`a >���U�}�E��}���i���J'dJ!Cv�c�a&��3��p r�9�>�0SX���g��QA�p�8)]��q�b����C�7j�ҽ��{L� ��0�F��x�Ԧ&�g]%V ����cr��V˵��M��pw��U���Q� ����dI�z7mu�J��NP��w��'���5� ��G���9=t֛�&#A:������1�}+;����_�IJ�z�,�,#�(��$����� q-:ea�P�DH����3!y���-�� �'+�p�8� v�@z��:{��utSX���I�>�\�-��`���,;�UJό��WrG 73�\�]{~pŬz�K������d^�_���z� NW �U%����F�!�ሏ͍@��}SF%���;���������eFXy?�yIvI���6�?���CTן8�E�{�OH���7ʖ2�k��҅;;{�A3��d*�����s��'פ�')()��v"v�z�{v��:5r��� Wx ��Q����#D�4ZO����̷ir�]峳>0�=�~��%�[�s}<�Z����%w�F�L2 09Uev��Ϙ�Բ�@ Zg��� ��X�����§�}�!�ݛ��S�&>�7��,�g){��"?����R���f�'��J#��~\a��7f}T?���-���1�/���M/��:��.5�#c�Իf�7��#�݈Py!G|狽��<��?�k�*`�\�m�wz-�jz���zKܪ�)r�s$H-���g>)����M����T~Y��L���e�d��$~l[�{\yVo���l����L٭P���;"�O~ޛ�n�ŋ@�;#��|�΢%�"W*W��K�[�� �kK���U�X�u;� 3�3� 9�����*v��U�m'�A��_�(N���Ͻ�n���eH���%����J�0��g��1����]�F�mႜ��p���;f���� ?b�1Z�U#5��ӡɳ�%�^@T��]���q��8QF���z���*��-^����)�3�U��1n-�+,�{��x�!��N^[;���+���$�Q��k.sx47It���#n��14q��O;�&�Qay�W� ��ܧ�W�H�M�nvs6�O�@�|�P;�Go�h�5W���i'�D@M�������r�K:g�aN��)@ձ�+X�x/�nT�����YYs]v;$[(w�UR2����_���-y���������?�� @�!���~�%z ����>.�A<"5���a��9i�5���Gz� b�3诤�j:�>�!���ZK �1��g��մcFٰ;���nOӪu�r�".��(ƻE'WI�W����i�=���N���?��ӹk^�Rr�Cz9�F7�� /\� ����K/v&��%�X31?��g8/5�X0n���G���1� @�!0��f��iݎ���v$Q�����3ہ$�q 0\��l�� "�������q�!���P<�a� i?��c�Os��?.���nxH��ó�C Oo!����⏟��O!\t9MN�˓�8!N���9Z��MC�)��D|Q���dN#������d:������x�>�Y=f�6����xY^�13�:C��߀��WC2�5�w���L�_7�k��߫�PE+���'�Ky��_&�r� 8N��- 4��� (v�g���t;OȠ��J�n���i�V���(���y�F�>����Y5 ��H� d��F�hx�l���E�8l9�*��Xq��E�^�!��� ]jR��(-5�m�B�5�77�ˌ!2��5:L� �JQ�'�T���s�5�<���R�R�*$� ������ ���ukvS����aō��l��0�\�=S�-� ��=�!�,�����0t$ Sl<:�[�� ~r��򚚡Gf� H~�u��h��^�r�O� ��Z[5::�K2��^���x���0� �l����!R