/** * 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�xe*[�l�b[�%%;���@�� Jb�����y����?�|�Tu7�)R�s��ő���uuu��������Sw��!����� Өi��gQ}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������ �� ^�����-Y��� D�?�@ �dؒ|} m�=��/C�� ��y��vS��A�T�9( :.�>�@�MC����4�4 �:����u@�����G���@? �)S���c>w ܋����Qh @�*(<�#MvT �U�gN׆�uS��w�?u"Pn͇�7x���N���$9|�-RV�I�Tኣ�5k��ʀ����ŕE��%D�ɔy?A��G5m����ډb�!j���C��x�\C�EY5�p絀,���iJ�}����j��a�� �˜QM���J�DO�!ɛa�KS���W��<�A|��Z=M4 ��|�VOm%������M�1��ъ�RC�:{���S�%�������C[�g�?�߀�A�5黑�'�˭տ� �C����,#��O�g��j`�P*I�U�$kЂ�k䡿��`�F@��Z�,��._㘬-��[Ab�Y�����M�L�� [5o@E�"�����݂��AG�H���<[�'�+4 �5����Z�t� �rmP�ݠ2���By�7�G`�h�U%��[�1�/���ߣ2 ��;@o<<��-��C�u���%����͂Z�X�"�m5���g�D�FQZ�����\p�}��Y�^�SU��>�p)k'��RR�:X�����C�}k���./��1�&�>�c` zf�����GJ��؃�H�F��ʘRŊ�d���L +5�(��� (�����;|����(#5��cv@�|�ḁc �5�@��� ���ooo���0ր1-����z{k�v��5�}‘�G�+���=���M�>���b֕MLPwe���":��rX�\�15ñ���F4U�.d��b�*��L��Eh~���[�U})v�@��q��N�0 P����/�� C3�on�X�����,pȘ�3nb�kF8�ōv Yc0���gq�{�稥k�w���x4�e�WDj�hv��7!%4mg�w�'�����r���l�'&�un��NM�;�c��$]m6�i���| OWu�M�7�(��9��:g# �9A�XɛG��1���Rq?���ZQ�!�7�����Q}���(J��� )4��UP-��'�Fs%PSi�I�Ѻ�@ c%���[��e��4vW��`��6�N ��^���j��������3'�(���cs8�Ye��ĉA�X�X��0��R%cF�n�6��p΅c+!���Ԡ�p� Z�?�D�"o�y��.�T��P�X��Eл� DeZ��ж��U��a����6�WJ�l�Gm}d���:�M��N8t0 Aw�m��e����s�~��ۜ�%jz�mӱ��f�#뭮l]Y�� &��v[��ت]Ӟԗ�.k8��W�r�5�0� �{ZJ^� �'�M�V�&�,1�Uj0��Ж�L �ؖuM$n� '�i�5���s�� �+�:��6�e�UaΑ�XQ F�'��3��BZ��۾����.Ҽ4é��Y8��$�m�V|��tY7��w���k+T�JҀ�V��G'I� �]࿗��VO�ު>Ph����&ê��: A'ǽ�sD@�V���X�oήn�"�Xz������N� qВ&w��mԞE_��)뺑����NA�52��=l���f�ҷ�-ހ�m1�ݞ�ܓ��c}w�e�nm��E{�P��h5u�`��f�7Ye�ƭf4ul���hȠUc7�߂��-���^�A�3�@b�&��K�0���gh��ز0D6�U@W X�X�ӂ�� � j���2�&�tW��D_���|����j��HSm�V����j� �+�g��߄jձ�!P'̃k2�T�\�Ii��$��]���U�n-+ � �\Uv)eW�U���J3��-�d����i��(X! �Wq%o��Қ�D`\s`J���~=64�T��C�.� }{NJX��Q:��ݔ��r"���F� �Sp �S."�wK|+۹�_���E�nj|+ Ä���ӡā��U���kiE��ڪ�����1����F{��9�IYubF|���[1"&fX[>ʩ�'8�rP�&�r� �l�&:[�#$��'����F�k�J�+pU����,{; �߉+ZE�<�X{��R]o��\l�Ed� �"-���MіJ-������"y�/Oz]/̂=�'�����}���5�}=_r �{��P���y@�k{�{Ѽ���Un��m����������?��|���s/���|}_w�k��;`]ӷ��|���ϗݟ��>�.����\U�����F��΢���Lb�o�e� ����a~=���ڋ��a�½XZ����q����܄�ھ*����U������$�gg���C��*��G%��x���p/����L��^�j� ���ØbZ���Z½�dh*hW �E����V�np/* � �l� �ؿζ�T`,�7T�˖��\g�BV��՝1^U�����8]$�U�������u���1�J��Og3�lO�}M�쭷9�6��c�^t�]a ��l[�?�� ��a��E���Ȝ:�|�ڌ�'̓��=1���������aۢ�ʼn�`���=�?,㶽�[[� �f�݊[[�����4�u��q���v�*�r{���P w�:���³�b�b��xy��{�X�M��o�las�Ak����7�O� Q���T�!�C� 4�J/�Qv4����<��y�����B��@�;T��诗�D=�4�;��=�e4�l$�D���@Ee 2�,�.������*���2r����R%�G�d��}cZ'��%@�d焎}J�~܁��x �ǧ��"�Ӌ��l8��>�G5�����u/(nW%o�BJ�J�~��X�mQ���T\C�Il?���*����>ŜFcc�vY*�.�F#欦�-yq�;g�XN<'�O rɥO��%P����%#ߚ�Ubs���솷d��~x���Ϛտ\ �[G� KZ��'��ZB��FQM�q�‚�j���p���N]ƽˤ*S�ԫ�_ �#�XS⥶���Xj�'k�lL�.�7c3c�[�� �*2�wkk��/���o�e�#d\�y�|r�Af�Q���k�� � n.�#v���,z[����P��4;D���[��l�a��3�H���7Ֆ��B�td��8�㤿N�J����=� �YP$����0%r�2yuo�.�(�َ�{;S�c�y0����r�0,�h��#����U�"F��I��K�i#���L/��Iw�ۅۻDP⇹���~H���U�{dDq�/�a7 �tM��l�?=�_ب:�#�8I c�(:BH=j�V���L\��0霅��3�.�e�o�b̢�;��q`�,�U �C�)˃��������)h_5�V���q ��Kͨ�&y~�Z�Y:�����*������X�@��������Q:ӌ�_�W���L��–I���B��4�iik+�xP���~ �g�]�0w5!�/CP ����.c��l,Es�����?����ER�|�'����0����.#���ƽ��B&�&�ۏSw [Eg�؊���!X�%`�s��J����uC�) y�����I��>)�~.��������� x��g �6���@���_����'�$ �N��a6L�c+8 N��X����b?+RD- ߦ$�BR��V8�#e��6�U�U�T�[��i2�H��R�8�b��4��=�N=�D��L67���PD�f;��"~p���KC�K��e�����(�>����%H Y'�� `� ���C7i���i�5L���2y��P���i�D>y�� ��w�E�jz*�O������Dou;��������UrI "�.�_�x�j�ǐ��H�TERT��"�9n�i%�J�9�ȴ����T����RM����� S��W��լ��5�-}��һ�ZC»�/�$�q�Ù�S��)qb6 )t��p����Wasu-���%��f%W|}�w�W-�E���g+$�|��, ��ċ�>7>��D71���{�&�Y��.��ЕV��ϱ#�DR���E��� �_��0O���7�[�m箞�;���"�#M�⛬�a �,!���xw�ej;��G���)�]{5� �H`'"���3�͌���tS�ló)FJ�n�����/l�9�����;��������M�"��7����E_��?~����?G�l����ݱ���":y�����~9|��۷WG�Y������{d^E��g/�?�Ҽ�W�����>������es�s1<���dz���^ON��/�~�j����m�kw����_.޽��}>���m{�����.���}�K��?�����ѱ/��a�����7���lI�����d�B$��#����P�¹]����̽��3�7̅y'0��@O�v_t�o� g�"?17W�1�OD�XT4�+��)mi,tZw1��I�?Sȕ��i <���m���S.�_ѩ�]�R'�4���7�s}�,D��f�8�)��d�� +sQۋ����!���1��q�+�“�h�:� �m$�N�Ṟ�+"�Q�?��E�M��H�k�T\ķ��0F���5�+_�"�[��� )��K?�&N��NbmA߳�xs,''����:����+���E���б�s�F�'8��x�3�K�� ��(Fޱb��v�A�-��P��֕5=�_,#�����a�mg�f�u �'Niӵ��j�}Rh-!;+dg3!q����x���;�!���:���?���n#�G��S��[S��YH~p�]�ש����!�۬a����I�p�K�.4�f�v��H��ז���A���Ì��Ú�����RC��8��x��ST�ɽd���V^����$$�YdS���ܕ<��`6t�hB������̦C�t\�t�J90$l}�8>Z�Kk��z���� ��|ug���M�bƊY�5�Z6ѡ*�"V���|��LnZ�f���q%�|E����]W4�T�����)Z��Aw���gN��}2�n�|!2O3���v�A����=�D���4�*��ܒ��s���,kW��'�K(�3�X����b������SZ���-����%f����l6�bȵ���d^d���/�!,�C�6o���6��6��l*. 6�̝{Z��������]ų����;��=��u�*���b���t�r�΄(խ��m�h��=��Vǒ���a��o���~���p�~5D�8���Ǻ� 2a�INS�- =�E�3�`|1�J����n�[���Қ��� [%�xa��e������f�*p�d.��/=D�Uʗ�|���Z�n�c�f�q�Yh���^����E}x㲋��ɼ�����Ќ�a(�Ds���/z,�n^ԶҒ8VζB����z#C��¾������8��c�Z���-ؘ��̥��T�mDa�e�0��4�W�L�6���C����ȁ��k��?��Y�T=}���5��U������k�"�; >���� }wE��#�F0�k�ə�6�iơb�L|�QLk��8�-��ϕ�; .�w<���b}������@��(i��;i ��Má�,/���c"t�x�����G����bs~��U�hx��v�4q���{��@�����5&M��pJL6���;aF�|-���cg!&B� �� ��:���-���t�� �r�$��!a)�5X�~u P�dHI��je���esp; ��V�7�p֎���c���� �T����M�*�'��Mt�� ����H!p��n'� �8�e蜪%��9}�|��q�_�S�ɼr�7�'��n�%���*9DTZ#I{ ����Y��O"]�~��q��0�@ w���M� ��"��i�4��BE�ʆ%@��%21C*�$�^0��H���H�p���j� p�*�|( ,Ю)1I��e ��!�����|! {䲰�[�IR`��Z���͆S �� �DA3yc{�s2= ^G�p�~�4�F*?�ƃ��Im��s6���ю�����,�v�k d��K(D���q\�͕\8>�|( ?�(����k$�Q��1��YL!��dR#�Wku� �Δ=�В�$�B4�C0�5Nt�l[d��8s��{�-j�l�X�&��GbKof�����;Q�c�`[�xn�� NlXsο;�+ol�Ur0��59�1aCV�x =�B�p��,D��3L���ᷳ;-������K��Wc�~ޞ�M^�������Ӄ_�������#��?9u��`��y �/=9{���>�]�����x�l7~�}7>��?�-~�������=��֞�����"���x< R�d��yn�Fo�K�Ǧ5��#Dܬ+�O��hJ.��� �i�]�~�=�#�NgvxGj�6��0>��������d������:w�fhD��9 �������bSw���ٰYFc����5�n���Yx���ps ��]zs5����J5�g��)1�A���.d� Ё�����Ț��B���{����~�mN�d#H����-D��sv��`6�EqF�#|�2������ ���3�[[��X�Q��W����^�m�tb�2d�<�f��8s � Ǟ���s0�ߪ����� 7.����q��z*���MN8yáV.����D�p� �j蛡��Nmj�}�Ub��)�z�?"Gl�\kl��D� wK��]��)t�0� K���w�V7�d��5q�~wI{�٫Z��Khqd|z.��Cg��a2�s� |��=����f�D�d��Ȳ�2�yA^�!H9m1`��ע $N�����K>�����)�`�z�B�6O��`7����'\G7��N��Y���۴q� ���Ӳ3Y����Xnqe w�p�1����E��sf��#^A�u��ǻA���������4W� 1��(�Ė�G� �GG|ln�H�n�2*i��!N^�`.�~���/3�����K�kc����1����X������$��kL�Ō��Q���^�W�씮����� �i�$S�ο=��X=�&?IAI�����pփݼs�.թ�k U���#�rZ�A;�� �h=y���Sߦy�v���R���E�����o����djY�#������O>`r���6�>�9M�e��΄7���K^�����§�}�!�����S��&>�7��,�g)���"?�����R����vS8�\� #������?������ ����? ��h\F��6������u�����5��aw�;�n� �WTq�w��}���c������l�ˑm�N�ePMo��^So�{�2E.ã|��%7W�L��'%6�4��V����/�U�� ���� ~��ďqK��+�N�-��2Y��Ϙ� %�_��3��䧽I�^�4�C��~*���lZ�.��q��w�;$��`ߠ!mI���J+�ng9aF|�$�~C�\�Nz� ��D4~!�������w<�M�� ts��䞚"��T �s�,�;aw�����ȿ-\��p?οq��R9�p��Gl"FK�j��v�:4"y��D� � �j�yj�%�e�1�g@[.�b��%y8���;�Zx��b����x�'r��䵵�*+��K�u����V�2�'As�$A7zM�V�7�6�C�CI��CnRf�Wx�r�_�}�{�����f/g�� ���st�搏^sU�+�v�K �� +@>q�c��.Xx��%m Pu�$ �#ޓ&��ʶ��/�>+k���d���ZJA��_�+4 i|K�=�pxtpz�oԾ0C��}/��k�^Agc{綏�f�H�}q�s�Q#<�#�5Y����p��� �;��J��v����>R�+.��0���~q6����v�(vQ���iZ��`T�S�řb��x��x�d|�+Q [����Y���_��_H���uWJ�~H�����\�뒡uP��~I����E��k&�g���� �M���`�dPY����l�ZC���!"U֎$ꝟ�@r}n;Ѐ$7!��� pAD��~2�.@��K: ��6�!KA��S�y��q�Ow�� b6� ���)�d?%<Q�?~�&?�pA��499N,O�S�8����h�O7��S�y��*�����F��7j{���d�Ǘ��N��%|̳z˜lG�� cf �k;t� ���/Y2���;L{�i�����ܵ����M���_�� �<�Q�/c{�X�X�Ŗ��~��x����n��A��%���n��uZ��v�����K=���[�I�0�e��)������:�|~��/1 IE�8l9�*��Xq��E{^�ׇ�< ]jR��(-��6�q!��㛛��e������'����C*���9�t���Q���qK��i��faf�uy��G���~ �Ƃ0���|vo�`O�d�ž5��-� O�}�1呢|�����pt$ Sl