/** * 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�Le˒�\l˱�dg�h��A@]����?�Ӽ�����)�K���q%H���3g�(�tW׭����x�������w/�4��{���qMo2����K�FM��=��+��9���_��g��L�3��=��y����\��B�!�iѠ��]jzc'�� ���*��cz����b�^L�����E������*�iMi#�����t}�V���9�� �� � Fg46�55È�C���ғH#���J���0�� 9�.;�mz�XTa/2q<'v�|d�.�M�� ����������ܳ�+��1CkJ�214����!�wB���NJvgf^*�̜P�l \3��$��)z�D��󕂨�<�%�|� O�z�F� '�����7�k��nnR�A h kT�@��=��&k2��؋�{���wyuH����Z �Z}� �\��n�ah^ը:��N�wsԪ �u9�����x����nH�y�X�`W��^A}�k�I��a�!�tS�}T��G- ~[�n���=�sϴ�[������R����B ����*N��ANR��N���>�*�F"�~#0�Y���Z�F%��t�x��<�G���7?�B�W�?2�c��ӧu�~A{��J��ў��c��z�Pk����� �� ^�;���-Y���0D�?�� �dؒ|}m�=��/C���ݫ�#��.�Ú�"�sP�Z�}��$�*FDC��i�i@0��D7i��/ l͵�����~�5S��$��)�|�8�]U}7V���BUP"x�G����)P�>�:� �J��B�D�ܚ�n�"߹s_Ir4��[�,����G�k���)���ۋK��K(���)�~�bA�j���s����CԤã7< ~ q=� ���ދ�j���kY��� Ӕ���C���J=�$���9��>�[����@C�7��h�KS���W��<�A|��Z=M4 ��|�VOm%����a�M�1��ъ�RC�:}���S�%�������C[�g�?�߀�A�5黱�Ǭ˭տ� �C����<#��O�g��j`�P*I�U�$kЂ�k�a���`�F@��Z�,��._�Pl-��[Ab�Y�=���͸Lü [5oHE�"�����݂��AǵH���<[���+4 �5����Z�t�C �rmP�ݰ2���By�7�G`�h�U%��[�1�/���ߣ2 ��;@o|5|��[����L�K������f�HE3�j����Z�(�k��$,���?�ͫ����ó�>��;<} n�B<�N����Pu� �W��l��]^2�c�M>}���������6�����;ı�;�<�``��ʘQŊ�d���� +5�(�T� (�����;|����(#5��cw@�|�ḁc �5�@��� ���moo��f0ր�,����z{k�v��5��#!��V��Ż�;�C����ŬK%�����l1�Et:+�`�*F���h��]�E�8�ULי����8��&������R슁F!�f;��Ya�đ�[_��fx��I$cE���>n ��!cbl̸�qX��7�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���C8]cmE1��X��Q�菹Rh���ZJs@Z��J����f�u ��@�J ����;J��4�+��8 ���)�1�+PQP-�Xc?�0֕��܉��$D����zV�A~1ubP)V+�l%L`�T ���۳�n5ܹs��JH��<��5h5�;����#Q�țp:�eb�ʘJck��zW���L+��֨���8 P�^�F�JI��������U���Z�ߤK�C�0p�?j�,���� ��KE���0-Qӛm�N�p22kYoue���z�hO0����rO��V������tY����ӯ�t`���R�lh=Yoj�R�0 �`�y�R��6����ej�Ķ�k"q#V8�L�I���#%�`h]�Ձ��(3� � �.:��`4{��?��NҒ�~�6��H�� g sg�|��`��ZX�9��e����׉��V ������7�N���A{}࿗��VO�ު>Ph����&ê��: A'ǽ�sD@�V���X�o�/o�"�Xz������N� qВ&w��mԞG_��)뺑���S��FF�~����6��W���0�-F;��3�{2�a����ޭ ��h��AR����bt#� �&�lݸՌf���p~ �j�S�-h�:�R{I���?3d!�hBh�C^l|�� ��Cd�Yt�����(0-�:!��`���Z!�-i2�NwH @��m�W�+ :a��*�.�4�foH@ڪ֩aq��x&��M�P�u�<�&�O5ʵ���) @��e��ZE�ֲ��7 2�Ue�R�q5Z�],�4��H�K��)`������ ywP�fp1�!��N�uL)c�^֯'f�F�*�I��E��o_���t��o�7�l��\������ ܂픆 ���M���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 �)��|� Y�t����m%M���x��'ݾ�vv��f��Ա|/�ﮰ�]��-g�FdQ���"b�~l��j�ڌ�'����=1���������aۢ�ʼnf`��=�?,㶽�[[� �f�݊[[�����,�u�q������p��@�i(���Ɲqw��e l�S�i���Z��H��r,�����_��9��5�bl��mB!/$Ua����& �� a�M�*`&O|w��*sp�D�{5�i��9,,��%5QO$����d�m��%I/Qpa$PQ���5#� |��s��t��5��L�ܦD���T��"�W2y��1�c�� e�sL'>%�?���{<�������"�cӋ��t4��9>�G5�����u�)nW%o�BJ�J�~��X�mQ���T\C�Il?���*����>ŜFcc�vY*�.�F#欦�-yq �;g�XN|Eb�@� '��� �v�y��}k�V�����ޒ�R��E�f>kV�r5�n��.,i]$k �><E5]� f��V��]^��:u�.��L�S�b |-���bM���v�c����U�1�o��ތ͌�n�*d�Ȝ߭����� lP�����qu�m�ɥ�YGY�B�ݯ�2����� �ϳ�m��6C���C�%S��n�n@�퇍��a̧"�B��T[j����؜�q��I�����A]'z���H�aeaJ�:�e����]Q<�B�(vf�Ǯ�`$���(?`X ��_+FJq�#�nE x�t�[[�p�s$Z~�rw4�)]BI��,!� �M}[��Gqe��3�S��Ԗ ���ъ�.���!ų�-�v,~0r��O��qռ�Z����5�N�0�v���ij]~Hd��Mn�ʯ��̕I5�g�+;���P �`h���LYc��q��Vh1B��\�Ƹ�`�-���̌�tAs�� q�� �~V���p˧ݰ��`ǫ��C #M6��亂��q��oi��c��#�|蟯���&]�H��oj�i��ٴh Z�2ˍ�(F�5�u��.I�K��$,@�gq���+�I1&�@�櫏]25|�Is�K:c�>*�,�� UQ������ê��DžM�0T��v��"����ܫ��4�?bY�OS���kh�v���*g���xy��a� �C��yj�]���Ua,��2 G�� ���d���[�T9˲�0`.tT��ݹn��#E!���?n��'E��%�:�u���o�چ���b7r� ����d��D`A���?̆ �rl�I:��v6Y�gE��e�۔�WH*#{� �Q�L��J���Jr��8M�Y�'V C��!<}�7ϱ'ީ'�Ȃq��f%~��w�H{�l��w?�B�S���A�"��A���b�\�&��r��� �_P&oS :88͘�'��A^����C�AOE�I=�����nGc� sQ�_ \�J. D�Ѕ�K�U��R���H�J�~X�3��<���?�"G���� �_\\�I6S4[ajV�jV��C׺F����-�����}>!����l� $DH����aD�˶GW ��=~�5W�b�K��z�lQr�W&�qx�bYt5�lm$�;o��c�8�x>����:��&f�u��9+�x��*���oDX�H��WB��R�2!W�K��IR2@�f{�����s~��7�]�h�iA|��0l �%�|��-S���߶8� ��M���ګ f�E; ���^nf�v9����f�M1R��现5Ј�x={`^���Ξ������Y�0�Tσ�{3�yx�[��h�㷟�O��s���߿�ٝh�ϣ�W�_�헃w?�}{y؛_�߻?����a�=}����潼4������ϯ��/��������Of�4z==yؿ|���՜߽�I�~�:���ۿ��{��|����v�����/~���}�K��a�����t��?L�~x�����)[����*`6�� ��%��8��pn�e�.$s/�� ��s�G� �7�S��C�[�ܙ��O��UvL�Q(���z|J[ ��] 8a���r��{Z��|d�"g�����s*t׹ԩ?˿"�ͺ�\_6�1Dt�Y"�jJ{?�)��\���p�f<�p�n#i�nC�G늵���4ZG�N�AEt����!���ȯ����_Qz��:��Z��m$�9�Qh�vM���ת���Vdw3�B�Cb����(��X[���8���ɱ(���N�v�c�����բ�x_���9�q#��qD<�c�%�u� �#�X�uj�����m(qq�ʚ��b�/�v�z������a��:�������z5�>)�����������}�;B��e�ːVf����RDD����#�3���)��<$?8�.�֩�f�A��m�0q~��$X8�%� �z�y�||$U�k�� ]�����aFv�a͊�c��J��!^_��r<��)���^2T��A + /Mvia��,����� �G�GJ0�N4%� Gv:�M`N糑g:.I�R���R��Q��GOxC�sN�����A��3M���z1c��:(��P�A%�`�=3Z�5+��A_�zq� �"�PB܊��]h�A�P��@����7����]nvr|�1O0���^�A�c捆;�D����7�*��ӒĦ�s���,kN��&�(4/�X���b�������Y����-����9%f�{l�5�Vȵ�‚d^^���o�!,�7��j��d6��6�v�l�-�5�zZ|��������=œ����;�A=����*�ggb��[G��9�y���T�M��M5��U[�X2����-����o�] ߞ揉���\x�u�� ���4�k�G渥�m}���x��4��t�[7�n�����w�?3�X� �Teu��)2H�5J2oh�b���� #>�}w�Aȱf�m۸X�,�ǃ��/������q�E(q�d�H����� C%����R�����Em+-�a�l�!����7r�14�/�I�(���<^a�����Á��o�]�HK5ئ��a��B�M�<���� ���:y/v�� ��s�N��H�2����VN�locC������I� (�O��_�+��}�`��,�&�;�x����1��F1m��d6l'?V� �ر��mo���`I/��y��Q���t����F< �Y^�c��D�C�p<�%ƽ�}��/��/�������+�n�f�� k�8���"��ykL�hጘl�~��2 `(�7��<02r D��7�����`���ăʋҁ����q�d�����[`1"�15@�%A��! ~n���.�\[�Z�)9�NXz���~�/�RY^��6��ğ�B�6��$`?��!��!){�� + �`D�֘s��������]@���O=�'�ҥ�$��N�m`�������gA�$�-�__� �1�?�g9��[��Q"�{gC ,�� �ZAEĝ��im��7� �?�H�Kdb�TI$�`&v�xy!�x����A�&U�6PX�]Sb>^���~�#>WɃ�B��ea��� ���*+���+��f6N���f��6��d�/^G�p@~�4�F*?�ƣ��l��36Q������c|~�n��5���%"M��8.��J.���$qJ\��Y�����M�:S���v�&5�m=��%��{�Se''����m3�c$�7��%��%����q_��f�+a�l�%��y-lEW�q�P����L�Tr��n*�u ${Ó���j����p�����q -rS�ax$��H�q�Z�É3cϻ鹲$, g�����{�7��8qNKe�Z|�Y2U%��I~g��oÛ򾰸�N�:�X6��%��ai�ǜ���ʻ��^�̪MK�lB��*^C��ǧ�>z8�� �Y �F�Mv�؝���������󫉿?o�O�/N'���[�����/�w�Ew��!{����o��0O�����_�O�?����f�zq����<�����w��������h_;M��k݃q�j��O�O�/�/?M&��0�OfA8��k��]B�86�)�!�f]J@Sr���6L����b��.I�1�+n�;R˷�xτ�%�����&/ '��й��㰭@#����D�������%����̆�2:���Q�I���3�ы3h�@8Y�ܿ�~^�$��Γ� ���������&�'�T�PQSV=+w��� �Is[W��i���7a�1޽u�����#Un>����wGj����lb���VdTl���q�7����-�B�2 ]��4�����Z�8 ���n.��� �J�/����R���:J�5DP�_��[Yb�o���C'���k���㞡뻤?h�͙ ���H2uݼ��Os��V؟O�Q������L�D�?����%d����V�^=i���w5gGn[U+�)� ��%���2�\�%ȱ��n����La5�jg��?�}�] �tE|<8ƻ^+ֶ�M�9yáV�����D�pC �j䛡�GJmj�M�Ub��)�b�?&�l�\k��D� �B�]��)t�0� K֯���V7�d/�eS��%�g�jMl�/�ő��dJ��&��HD��)&�3vLw�ʎ_��їa����"� �H� y1� �ŀa4#\�NY0�8�|/�DH�w~A ����� 1����� ���� �2�)�4�dQ?K�۾��4�������F�m‰���0򏍏+��c�j�����?~���`L��e��j���N}�K���7���퍺��H�a�T�<���/�e�"����~�y.Ƕe�;��A5�m�{M�%���� ��9��\H�3������&ZA�k*�,VG&L��1�%q?�-�=�<�W @�g�du>?@v+��U��B����&��u����&����g ���U��_L����>�AC��%]��*]�Ⱥ���Q�Td�q �r;�e*�j� �=�^��s����w�B�2$�� ��Kh���S%D������]����[#��p���7�F�e�Ki�x���y�-ɪ����Ј����*x/ �IஊP[�8�P�(#�MH=�ri{�/�����ת����U���:��kd'���TY�}?�XŨs�珵�9< ��$ ��k��տW���8�Iҧr��0���+u��� �Sޫp$�&O7�9��GL�n>p��ã7|��R�״���H�4Y��� �t��Ü,iS��c�T��4,W�����YYs]v $['w��Q ����ߏH�[��ч�����xQ���>C�3xA�\K�:�;�}\6�xD����a��i��R �d�#=����W�@��O����_q%�ᇘV��������cFٰ;���nOӪu�r�".��(�KD'WIƟ~�iaӒ 7�{�����{�s�����b��썮F�^�ZŻ�4^�L;K��fb~6/�p^j �`ܴ�� �G�L6�%�A` �V�5Һ!Re�H����1$ �g� Hr�`�O�PD���'ӛ��,���P<�=��w?��c�Os��?.���nx8�A�f5��:e���xH-�� ���A����8�<)N��T8~����>��N��%���'s�ߨ�%�'�y(_�8ƻ��1��1c�qT G��򂌙����2����dɄw�%K�0����n�r�v�۽W7��V��O�ד�HG �L��bAp�b�["h�هPl�i��+o��yBe�w?w��vO봚��F)\5�{0z�q�7�Β�a��"S0�9b����u���,�@b@� �rq�r�U4H���5�v!.��C ��a;�ԤiQZ��m�B�5�77�ˌ!2��5:L� OFQ�'�T��U�s�5�<���R�R�*$� ������ ���u=vS����a����:l��0�\�=k��Z�8��{x�#E�f� ��5� H��x`�&9A����55C�� b���B-�u�g�)�u刟�A,8Pѵ^��4 _�����¥�/� ��$�Y�f�5�EЎ ��zܼ����F��{�ۊf(z�譁�4{��}��({�'����