/** * 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@]�h���y:o��}�|ɩ�n\ R��df�ő���uuu��������3wo��!��M����c Өi��gQ|��=g6Q\������S�L��@.o��<���x_�4��4�� ���R�;a!�FW1 �S,�^��{1�b5p�Njԋ����ʖiM��G��HE��o� �U>G1��Y�����&��f�x(����{Q� Ϝѡt�Ћ�c��C�±��Ц�Ee�� �����,ӥC�����;�{�yE�����5�A�D�Ԟj4��*Ot'�G~��$wf���� �A���5� �A2[��NT�9�SӜǾD�O �S�Oj`Z�\3�&T���!hбd���i�%���OZE@�URH���E�Ș��t��ێ��c�L|U8��0+)�.H�1�H|�~� pˌ�S�(��r�B�d(� ��h�]���tZS�44����%������\�� ��� �/ڔCK�� Y]m�w��Ќ� HtC�h!HAvY�� ��Z��{ ��'䴸/j��e�~6���C�_�g�>�� _���g���E@g�g�P:�$"Cr-�̈���4\~T?��r������n�*6�UV����Mi~T��e���J ��J�M�%:�� d��� ���݇���Z���Š�/��Gt��g�s�~�X� C]Q^8�o�i8�(]ŐnnvA����ԉ��q)���� �hب�G�g��֜�W�>7C�7��M҉U���8�by��:��OhGڈ�<��`P��9�u��t��h\���F4��q쇠6��� |�o�p|�V���M��U-��o@/���ܤ��@֨b���{j�5��5����^� �����CH�@��b��\��o��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���-h�U �-���x ^�R�j ���4���@28�.��&qK�� s��`��C2l�q}m�=��/C���ݫ�#�����5SA��$豰���a* ������>xPݤ����05�>����i��� �LO1�sDZ���껱�����?���A���샩��аn���.�gNʭ��/��1���Ԉ�x�l����ኣ�5k��ʀ��ۋK��K(��kP��ł Ŵ�� �k'����I�Gox��x��s �e�pÝ������)Y�A�����J=�$���9��>�[����@C�7��h�KS���W��<�A|��Z=M4 ��|�VOm%����8wݛc�4$�yi+�y��R t���ӧ�KX��%VA?��X��-~�E��k�7c%��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����V" �Z�( ���ܼ� ���1<�������ӧ�.�c ��ZJ Uˀ�y4lߚ��7� E�q�O��0���;3���j� �)��q��?�A$k z_ęlEQ2��l6���}�J60h*�n��6�Hͨ���)�.`Es��s #�k9�%,{��[8�E��5�_Yqr���e;Q��W‘�G� +���]���M���b֥MMPwe���":��rX�\�13É� �F4E�.d��b�ʦ�LL֔Eh~���[�U})v�@��q����0 P����/��B3���$��"֍ ���Ba8dLL��71�5#���F����1UR�G�8���3�ҵ�~8x<�w3��"�i4�Mk�����3�}� .wsƃ�����6��;���IeA�[5��A���@�X',IW��f���!&����h��M�5Jvv�y���H�dN�*V��iz¢�T<}?��e`�a�-�f@+32��67C �bwTKnHKm�jʭi��[� 2VHθ��ޑ��wG������U�Sc�����Z��~�a�+���M�I�^�9��2��b�ĠR�V��J��t��1#\�g��j�s�ܱ吂_yl� j�j8w�ןG�X�7�[I��Z-����� ����׉��V ������7�N���A{}࿗��V�ѽU}�&����M�U��u@�N�{爀�F˩�ߜ_�B D��N;3 Hk��_���%��1ֶQ{}YC�fC׍L�~���72��=l���f�ҷ�-ހ�m1�ݞ�ܓ��c}w�e�nm��E{�P��h5u�`��f�7Ye�ƭf4sl���h4@�F?�߂��-���^�A�3�@b�&��K�0���gh��� 0D6�U@� X�X�ӂ�� � J���2�&�tW��D_���|����b��HSi�V����h� �˲g��߄jձ�!P'̃k "�)F���6�H����W[�(�ZV��AF���R�0�F�����f�[�~��F X��/�`�0H^���\LiHk��q]S�إ������x� f:vf��W���:����M9�!b�߻l�,C�;�`A;��B!�Gpc�� b;���t���q�od��Y"r:�8p>�j=y-�(�S[u�]�A~�9�մt�hoT6G4)�L͈�\x|+F��� k�G9����Qj�DW.V�� ��D�`+p���5���ҨqM\)|���t=��eo��#�;�`E�(�Gkb/[��1��-��l\��Y����)�R��xy�R^�#o��I��Y���!����۽�}���K�Cassj��;Hxmot/�w�Q���M<׽Msv���r�'u�����y��A|������| w�k��;`��O������\߇݅�]|ם�j#�uWS��W�Y��}ԝI,�M�,dsZ�;̯V�]{1b;�XC�K�X�=.[]���PZ�W��� �U6v������v�U}h�RŽ���X��Ev�R��R��KP��A\\xsCL��<[K�� M�����QU�J� �E%AR���d���� ����*~���U��� w@��U໼3��*���Y�����ya��,r:w���~̶����� <�Ɠn_S:��m��h�X��wWX��.����� 2�(pX}@�;6g�{5|m����~KӞ]M{�Xk�v�m���D3�� Ǟ��q��ŭ-�H3��nŭ-YN���p��:���Z��J��^�j�4��]E�θ;��2��ش��e-^^��^9�pS��k�/[؜{�y1�����mB!/$Ua����& �� a�M�*`&O|w^cU��܉@!�j ӊ�s*XX��Kj��H���ɞ�2��K6�^���H��2kF�[�b��jk �M���C�]E��9��ƴ���K�l��c:�)9�~����c��.�&Y�^��������<� m�ŗ�{Nq�*yK�R"��#h���� m� ����*Ob�ŖW������)�4C ��R��p�4"x1g5����% 윱c9��}A�K.�xJN.���}�Q2��9Z%6�Uf7�%���Ë��|֬��jX�:S\XҺ<< �b}x4�j��;�V#�d���@�u� ܻL�2�N��)�`>��5%^j��N���z�V��4��{363��(���"s~�����"�*�A���!�����K *0�����^�_ dps�o�ܟg����m�2=g�!J��'�Z�B������0�S�v��o*-��B�tl��8�㤿N�J����=� �YP$����0%r�2yuo�.�(�ێ�{;3�cWv0����r�0,�h��#����U�"u�4�gZ���s��u~.����#� h�%\@��얐�K���1� � �?G�ǮYr� �G�Vݷ���@�"P� �"��m%�/l'>}�}�/v႗�LJЇ�a`)�4���Y�c�_�F�&5��L�o|�PwP/�������y�Yy�?1^¿�X o{�?��/~�������o^������#'����̌��Z�rcl������F��W�_ez��8,���.��%�?�]�%nD�C�T����%c��|) �q��j�g0J����������.���YuF�YB�P��� ���6��X�O=s�R�A��L�Rdv��%�%Wf��ay�;���x*�c ��}Ӫ�{�˘���ԥh�\���F�]�HJ�O��<4~xpQ�WY{۸[\Y�$�dq��c��&�]��QOC%Qt�5'�Uκ$�ۄ:�������m�4ey�I�f':���DL_�PUAH�� .�k�D7��$n�TCx�Q�S^�� ��Fԍ̔5�C��M�O�K d�������PG�m��$X�@|�।���z�q,�,���ȉd�#jbb[�b�3�)�Χ�0�X� �"F�w�����,�Eԑ����.h.1Q!.�5!����T�m��v��2�xe�u�Ca���w<�\W0P�.n��-��q��|$�}����l���GV4Ra��Z~چ�|6�����rc*�lMi�zK��|>� P��[�7'D��eR� ��"����c�L�_i�`����hπ ���ŧd"U�a(&���*-�qA�/�*�]&��Ȣ+�=�j�?M�̀��S�T������h����m�� ^c�:H���d~Zx�?olU˾�L�@�b�-�tF���*:3�V�U��,+ � U��}w�z�H������ߏգW�$�{�ģW'����3������m��*v��)]Of(I���l��/ǖq���� .`�a��~V��Z�MNz��0���p>E�Աm��$���$����d0� ��|qb�04��Sgx�{�z2�����l6�:z�����v�UE������������I��y�/P �}p1%kK�(�,N���- ���n��-��>SM���2y��P���i�D>y�� ��w�E�jz*�a����Dou;í��EUd~�p�ʹ$B�/a.K��q��|�Ǎ�u0�M�Du��9+�x���*���oDX�H��WB��\�2!W�K��IR2@�j{����s~��W�]�h�iA|��0l�%�z��-S�؁߶8� ��M���ګ f�E;���Znf�v9����j�M1R��现5Ј�x {`^������#�O���,� n*�A���<��%�b�����'��1ze�����N�������������޾�<�̓/ί��C��0�?}���潼4�����鏯��/���������Of�4z==y�?��멫9�z'����u� ���:������÷�����x9_�8�������������c������W��\ ��E�z�f�� ��Y�C �v]��B2��{� �Hl0z��Pz=��}�1�5ϝ ����\e�>�bQ� �ǧ����ia�ŀ&��LQ Wr��0�p+�G�Y r�O� ~)�@w�K����+b߬;��e�C@W�%⬦��������Em/ gh�C ��6�����y��X�ON�uD��T4@��h|Rb�9tz��+"�;�?���D�(����V�A�E|�{c�]�?s�*�����L���X���h���$��=+�w�bqr,��!x�Ӻ]�ؼ�=v�(7�:��|b�H��:!���8c �D���/��b�+�Nm���"� %.nVYS�Q���2�n�^Ϻ��v6l�X��y�6]�ZO�F�'����Bv67�Oq'�����br�ʬ�X��C���6�[Dp<�Z�5%<���;���:u��?h��&�oX� ��z�BSo6o����*|m9���t�?��:�YQ|̱XI�!5��s^���>EU��K��8>(�`��e�.-LB��E6՘�8�}��H�#׉��<��N�� ��|6�L�%IW*�ak+ű��'�=j:��s���/L �%�i2�7Ջ+��n��T�� ��p�����2�Y�� :z�U�;c�A�nY�)�q���;hve�5Рs?�b<�F� ���]nm�|�1O3���Z�AЊC�F9������U��#��$��h��\۩*�Z��Xɳ� ��=V�%�Fgc#���F�c��aK{��yN��|���kMfr���������{˶ �]�@����R/��f���[��܇��� ۲��J���S���豄;DxQ�JK�vX9�R�t��+�����}a_�HJ�@�_��q � -��Tg�=w���R����a�0C�M =�W�� ���/v��( ~��󖎜A����e'�d��Q6��k�"�; N���� �xE��#h,0���ɩǎ0�i��4V�nS�9)��ʝg;<��m��Y�ea��gB[�6lঁ�|���f�1�V<#���1��c�u� � �2��E4���zڼ3M�~a��#�a��8_괉�Έ�&����"@�����Zy�,��@�~Ag<���M���.g^ ��c�1��&�P�.c n�#��S�1Q$a�R������޵e�%���鄥G�)nm�)�好�ӈJ� *DAi��v�8HH!pt�n'� �8��未%��9}�|��\p�_���3�ҥ�$��N�m`�������hA�$�-�__� �1�?�q9��[��Q"�gC ,���6��$������Qo*������ �(�Hz�L�"��B"��/�%��M���m�$�@���| ���%�BG8����4���o�&I�UVj�?�W4�l$�2'(��� ��4�x�ñ�A��T~H�G�;��B;gl�����c�����v�k d��K(D���q\�͕\8>Ggz��3�\�P���$]�O���_k+�ϯ��k$CR�o���14�yL!�!��F�4��N�{�Mϖ%1I8�8��\l����7���(p�*���{ђi+�DM����ΐ����w��1Dz��/,�� K;��X�=�W��$���`Vm`rf�ƪP�� >Z��éfvh�j�0��7���bwZ ���G�/�_M�}�y{|:}q:����ןO�¿�/���ٓ����}����y�� ��������lv�� �͏��i?~�}3�����?G���h��\��CVk�x�~~�a2� ��}2 �A:7\���bƱiMy9�@���Ğ�� Д\�ǥ;�軰�X{�K�-��p���m6�3a�m y�c��� G�o���.�>l�Јt�s0���a��e�Ŧ�0;8�a���'x���y�O �� ����� 4� �E{�_BG/�?��?Hc�I�`CPx��uuw���*j(��)���; �&�����킫��UJ�2���޺w��g�*7"��޻#5O��{6 1 Z܅+2*6�B����E�n�L!\��ޑ�]C��Z-Q��ǃ�;7���ۅw����BS����_%�9"(���m�,1ڷq��Ys��g��q���]�4��L�Ov|$��n�B�{�.��'�(��r�o}R�\"������2|zpk�b��4J���;��c �����ƔB��8��LVg.����s~�{~`���[����v����pR�,> �}����&����P+�����\�o���I5�����65��*�Z�pᔯH �j�����\n��9� 9�S>�a0�A��eWo��nPɾ��qj����ijW�&6������\2���z��d$"H���;��oeG1����0�B�Po�e�e����D�r�b�0��!�E�, J���+�|&$�;���SX�B�d�n'���HoXgGO4��n k�x)�����c�0L��e��J陑���R@� �cƗ˻�`����5C�x ��~�w�̫���� p%�Jᗿ�j�d�Z��<$!�h#��nʨ��W|+8y��\��V��+�6/�n�ك����'ZZbu����c��{�� ��bV�`���^���n������i�$S��?+��=�&?IAI�]��˷pփ]�s��˩�k U��c��*���v!��z�8���g�M�;�ޞ����9����(�ʝ��Բ, G.�6��N^���ɩ*�k?x�4���R�:�H�nد�2����>���� ���� 73�9�4�da?K�۾��4������G5�O��W�@�G�� 3����������|%��_mz��ĩ�u����5��Qw�I7�*��ۧ8�;��ž._���y\�Wq��rl[Ƹ�kT�����[� �L���ȟ#AjɥT<p�I�M<�m������bpd�$�.��_'�������C�x��f�����n�7�V^�~��ޤt�.���^�d?�v-A�� P�K ��^�^7��7h���KY_��Y���0#�9 ���l?�!P�b'�X�]s"��Ջ�t~���;�nZ�[����^r!M�y���9�����p�uk�_n�Y��_��Pv)�O�@�=6�%Y5Rc[?�<�["Q��D5 �Uj�'�e� �g@[.�b��%y8���;�Zx��b����xc'r��䵵�*+���K�e����V�2�'As�$A7zM���7�ڙCAI��CnRf�Wx�r�_�}�{�����f7g��� ���sx�怏^sU���v��Ԅ�*� �O/�X��s�dI�T;����� �Fe[K�Y��5�eWA��r��!%#^�/�]��_�g�>���˲�͐�B�� ��Z�����ޙ���#RC��8�ƨ��ZC����p��� �;��J�v����R�+0���~q6��PM;f� ��(���4�ZW0*�)��L1Ќb�Htr�d�鷝61-�t����?���k:w�k_J.yHo���z�\ᅛ��uP�o~I����D���k&�g�� � �M����?2f�hC�;��l�Z#���!"U֎$ꝝCr}f;Ѐ$7!��� pAD|�~0�9.@7��t��7l��!���wL�a�Q���7>� �4�٬&<�}����xH-�� ���A����8�<)N��T8~����>�4$���K�W�/N�4�O�P�K�O��P<� �p��,�c��c� `�8����330_ۡ3dh� �~5$��WCz�i�0-�4�u󗻶��� U����>�_U�#%�2����q�5_l�h��g^@��G=W���yBe��?w��vO봚��F)\5�{0z�q�7�Β�a�7D2�` s�vxG��dG�Y$��Ā�(��a�W� �NJ��,"؅��1�>`�X�R� �Ei�qm��� ����Xf �Y���a�XxZ� <9�R��8��A瑎������T!9^��onffX�w�+��r���l,�(�gWb ��I�*왊�l�V�x����(�d���w4d�ؠ3 I�b�)�_���į��� =2��m@��#�� �E���#~���@��R��N��LD�xu�l~Vpy&��2�WۯA*�fi�O����/ \�6�7<֖5C�{Do����[�mY��ߌ��