/** * 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\ye*[�l�b[�%%;���@�� Jb�����y����?�|�Tu7�)R�s��ő���uuu��������Sw��!���� Өi��gQ�o��Kdz�K��2�S��sBc�1�Ȁ\KC3�g�+��Տj�\*~8����}�z�G����mES�ծq�5>�RC��xcx�.�w�6���#�'|���Կ�����b�˕���Y��F��#��0�Pa���� :JW1���=P�#r:q"2r\J�/�$yL=6j��h�Yh�5��կ/̐���A��tb�h�:�,/\G���)��O�3�'s�k�$G���\���j����F�9��Ԧ@�#_�?��U"t�cg4���� �Ś ����|P�U,5|O���5���؋�{���w{uH��S��Z �Z}� �\��nah�kTOX����j��z#�����xj<7���Ƴ�#�B�浴^A}�k�I�A�!�tS�}T���- ~[�n���=�sϴ�[������R����B ����*N��ANR��N���>�*��"�~#0�Y���Z�F$p�t�x��<�G�G�7?�B�W�?4���ӧuG�A{��J��ў�G#��z��Pk�4 ©���A�p)vm5�[�To�� �C0h�aK��Kh+�!�}�?f������z��Lឃ���������`P4�:�F��S�A]@t��h�~�B�\��_��A\34�2=Ř��������JZP�J�Hk8 �  Գ'�kCú�R�П:(��C���wn'��FR#|�-�!��S�S�+�׬��(*jdo/�,�/� ��A�� *pӶ_\�\��(��&�9�1�k��g��5�^�U� w^ �b�/o��d�0��H�V��I����$�ܪ4H����tH�\��v?�����Y⻎��i�Y@��;�zj+��\��D�snj��GА�祭�V�J5����O��/a}njw�X��b=S��Q� �Iߍ��?a]n��� J�pTo�r0� ��I��;^ ,�B%I��ʑd ZP�y�/�r7ؼ���V!K-�7�q4և��� ����^�� ����\�Aކ��7��sFBPT@ �n�^sU���ZԘ5�;x�O�Wh�+j���#��58�B~�ڠ�5�Ae�ӧ�� ޜ���V��o5�,����wo|�r�(H ���|�H��M��֗|[�j7 j�b��,f�����Q��EIXh����Wr���1�g�{�O1vx��¥x�!�xCKI��`�V�#���[3t��ƒ�H#n���>�0�g�Y���}4�4�!�=��g1�dM`|�ˠ�)��(J���а⑚G�g@�ME��í�F�)�s�:��c.cp�a�}-g��e{{ 瞠H4���f�'��[[��9�����J��K�+����t�g�Q���o}�]g��|s�HƊX7*�>V �Y��11 6f��8,׌p��:��`TIE������QKז��a��h4��/�Ԧ��6�=nBrh��,���Op��3��=�F�) ��� OL* �ܪ)���w��:aI��l6Ӵ= 1�䝮�F�No2�Q��s��u�F&s�T��7�L�c]���~���,C8ccmY6��X����菙Rh{��Zr�OZjs%PSn�ISm�d ���@r�-�� |w�ݕ`��'���)�1��PQP-}�Xc?�0���p�Dy��zl�=�̠��81��k�&0]*`����f��¹pl9��W[#��ΝA��g�(V�9��eb�ʘJck��zW���L+��ְ���8 P�^�F�JI��������U���Zg�I�� �fa�"�Ӳ�ct�s.���/`�3ôDMo�m:n��Y�4�V�a݆^'�L���v��Cb�NtM{R_J���v^����t�:0��i)y�ah����n�^a���Z��m톖�� ]���If�`Mb5�)�C�6Z�wq�2Ӫ0�Hv� ����k��3��BZ }�}y��]�yi�S���p6]I��Z-����� ���߭#��PA+IF[-n�$ ��v��^�Z�F�V���@K\�7VU�� :9� �#��-��:|svu %��;��( �Նu�N����F�X�F�Y�e � ]72ww�)�FF�~����6��W���0�-F;��3�{2�a����ޭ ��h��AR����bt#� �&�lݸՌ����p~�h��M���`K�%���k�L!��� ��R y���*(� �Mg�U�2���� ��G�a��j�t� ��@:� -�W�1_i������@��T�� =i+Z�����0�7�@u�� ��Z���Q�Ť�Mi���.���*J�����a�Q�*��2���*�bq�����G�_z��i��(X! �Wq%o��Қ�D`\s`J���~=64�T��C�.� }{NJX��Q:��ݔ��|"���F�2�Sp �S."��I|� �sQ�Nߋ ��V@� ˑ%"�C1�gS/�֓��Ҋ"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��� �7d�ә��1�c��4՟�f��6�t����[os�mF��辻�1�_φ3/���!xTڞ�/?P���vU��(�D/G��G{����O�5T���#�-�b)/K��S�i4�0j������iD�0b�j�oɋ+$�9#�r�9�}A�K.�xBN/�ڜ�>�(�� ���*�ޒ�R��E�f>kV�r5�n��.,i]�%k �><E5]� f��V��]^��:��]&U�z�^��Z0�Ś/��|'�RK=Y�dc�p�����U�V�9�[[kuDؠ| /�!����擋 *0�����^�_ dps��ܟg���U�m�2�`��!J��'�Z�B����?f0�S�v��o*-e����Ȝ�q��I�����A]'z���H�aeaJ�:�e����]Q<�B�(v��Ǯ�`$���(?`X ��_+FJq�#�nE x�t͛[�p�s$Z~�rw4�)]BI*�,���)UQ������ê��ǥM�4T��v��"������B�ܠ�M�OS��7lh�v���*g���xy��ak?�C���j�]���Ua,��2 G�� �)��d���[�T9˲�0`.tT��ݹn��#Y&���?Q�_�,���_��:YLπ��y���!,g��؝�ʧt}<��$Xtz��a��[�!p���*�l���M�Y�"jY�69�� ��޶��t�Ƕ�������ܪ6N��D*D��ʼne��p~ϟ��s�w���&�`�d�y�����"��3۹HT�CK�n^B^"V.�'�O���@���Ŕ�-AzP�Ȳ8A�Fd#�X�4��I��\G�L5!� ��m�CA���}C7�kܡ��9��? �� o'z���nd.�"� ��V�%����~ 㱪�C*�"@RIQ ��t渙��p(�B��#ӢC��R����K%�f�fb�L�r^�2W�l�Z�h���nK��j���u_�I��|�3� R��<0lR���|��ϯ���Z�})������"J����=��Z.��ӡ�VG"���qY0 ���}n|���nb&��{�"�Y��.����V��ϱ#�DR���E䊖 �_��0O���7�[�mg����~���"�#M�⛬�a��,!���xw�ej;�����)�]{5� �H`�!�����͌���tS�ló)FJ�^�����/i�9�����;����_M��ρ�rDߛA�σ�ߢ/F���tr����W������X{~t��j���o�����۫��,������=2/�"�ϳݟ_i��+���{m���j�j���۹��~�����F�'�o��??s5�w�tܶߵ�;a���/�^��>��p������?^�F�?�~�>�%��a������0����՛��S�U�U�l2_!Z�K@�q(a�ܮ��]H�^p��� �B��Ho��Z�/:�ܷ�3f�������'�P,*��E����4:-��p�$�) �Jn��ne��6 D��)�����s��E�u���l�c�� �D�Ք�2PS�����E� �xH��FҘC܈8�����Y��h�ރ��6�O�C )f���ߣ�������~�u����*.��H� ��p�����U�݇���f�����F'�E'����Yq�5��Q| �[�����������xc���9�q#��(�"���1��¿�b��w��:��zPw��6���meMAE1����z=�~�v�ٰ�b�B�S�t�j=�}�ZK��� ��LH��>�=!��2��e�!+�Ncm�)"��H���9��j�֔�x�l��u갹��u�6k�8�am,�� M�ټ]>>����t��z����0#;�fE�1�b%���/�y9�w�Uir/*������&��0 �f�Tcj�w$�"9� ]'���#;��&0'���3�$]�\ [_)�������çC��޹�xo��� _ۙ$s}���bo��Mt�Ơ��^��)-�h٠�w\��Y_d !nYk�Z�T���n���k_���3�ɾ�6��d8'�� �� d�`>e ž��G� x ����RG2�jIb_���fTU�5��a�g�{�RK�1��F�m����|QÖ�_S�3�TX�?6���,�uaM2/0N{����m`�5�I~<�zHU��:���_| s����l�b� =–O�x�;{�XO"b�� �������Qcn�r�~�(UlK�5�0��Um�c�l�K|u��V���Z?�Wt3|��?"�CBA�iN�4�� ����4厭uZ�n�T�5_h��3���ҭ�9�uZ��^�֚��f)��纊���d���/=,�ɗ�|V���.�c�f۶q��Yh���^����E}xりP�������j� ^ �hqϕ�E�%�����VZ2��ٖ*��"UWt5C{�¾�������8�����Y����N}{�R5-��M'���l���;��� ��&�c[}���9|="b��:�4+�*���������FU��>���J�"(8P��_�+����b����&g;�x�Y��92��F1u��dFl'?V�!�ص��m�u趒n&��X/#���)`7 z೼��z��Ћ�ytE�{����_� `��1W.��]B���Ifvp���0��7��OcwZ �����/��_���y{r6yq6>8x���_O~��/���ؓ����}sp��y��)�������_�lv�W ����ݳ������������9>Ў���Z�p�Z{��������O��x0H�Y�9 f�Fo�K�Ǧ5�$ܬ/�O�hJ.���=�i�]�a�=�#�ffv� �Gj�6�0,�������⌅����л���-C#ҕ��X���/���%�����̆�2��)�Ɠ�!<>146s���' ,�|�p��!���H � ��'�� A�����&��*j ��)���{ ����-�������UJ�[1���޺ w�⧒*� � ���c5O��{6 1 Z�+2*��B����F�^�L \铮ޑ�]C��Z-Q�����7���ۥ7W�Kkh��Tc{Ư�� ����B��ظ�ȉ���3y��g����7��T�O�z$��n�B���;gGf�Ygt9·>)S.�����`a >���U�c�E� }�������J�bJ!Cv�c�a&��3��p r�9��=��/SXӭ��g��7A�po8)]���׊n�j�E�p������n+�7�V¤�fh��R��lku�X-p �d��[-�{�6�k� Q8qW!�{�G]6 �_#ȒU�� �� *��_8H@M܊�]Ҟx����&Z��K���Yo2C��D�b;c�t���:�}&Q(�-�,��t�@��RN[ Fs0ĵ脅�!1~���τ�y��p +X����͓�2�e�������MaUo#EV��r�Nlf�)�#���U)=32�[\ȝ�`��ryw����Y3�W���n�y������5�~ �&J��寊�cA����6R�ᦌJ��7���!�˥~a�ˌ��~h��V�}�om ��%V���?v<6�����d-#=a��d��� ;;�vv�?��fZ#�T��O��EO�I�ORPRr�D�.��`뜰;sj�C�~��@i� -����G��h��<ci��o�<���gg)|`�"z���gI��r��x��, ÑK6�3��O>`r���>+M�ew�΄7����� a����O/��tC�{7�����L|No 2Y��R���E~$�����6�Q�vN8�\� #��~\a��Wd}T?�������1�����M��9�j]j6�ƨ�w�no���v B� T�o�b_�/�X��<.�8��s9�-c�� ��ms�k�-q�V��ex�ϑ ��b*� 8���&��6� �_S�e� 82a~�݋�/���Imi�q��H�h�?�AV��cd�B��U+��`?�yoR�fo�L��h�� �>;~���|p\���xq/I/��7h�_[ҥ���Ŋ��YN���AE��(W��^��.8 ����Eq:?�~�q-�-��`?��������I��$IЍ^�����pf���P�>퐛G�Y�^����Wp��^�#a7y����4?hu�C��9䣅�\��֦���5!� ����1,邅�9YҦU��`=�Uh�Q����C�ge�u�u�l���GɈ� ~KD ��٣�G���� 3$}���������t6�wn��l�Ԑ�/Np�1j�Gw��֐b�'#�7��Ρ���:��|�����{,) ?Ĵ�@� �?Tӎe�� ���=M����q��8S 4�/ϓ��~�ia'Ӓ�7���������s���J���m�]��+�p2��w�/i�ع(v�c���l^��T_b��i�U�G�L6mH|�@_2��^k�u;:$B��ڑD��H@��m���!$�p1���.�H��O�7����C���M4$���c�O3��?.���nx8�A�f5��:e���xD-�� ���A����8�<)N��T8~����>�4$���K�W�/Ng4�O�Q�K�O'�P<� �p�7,�c��� `�8����3S0_ۡSd�� �~5$��WCz�i�0-�4�u󗻶��� U���+}���G:J�el/ ��k���@��>��b�z�\M�� �N��6w�=��j��p�<�_�������:O����ɘ���1� ��=������(�-�\E�t+�_��`��k:�����c�KM*���ƵMc\�����~c�1�Cf��Fi�c��(*��J���xN��G:�cT�7Bj�S��xAZ��Y��a]޽��nʱC�� ̣�'�]�-�&���g*^��[�㩻���<��o��ѐ�_�΀$a����~k�S�O�B^S3��"�>�O�!�b_)`|�»W���Ă]�F�G��LDfxk.m~^p}&�2�7ۯA,�vi������\�7�7܆ߖ5C�{D�Sb�VoQ�o�ey���U5ƫ�