/** * 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[�%%;����@�� �m�u�a����ż�O9_2Uݍ+A���9�Fq$���n]]]}ųGGLJ���{A�����~��kz��D=��D�4j�d�Y_�tߙMT����z�xʔ:�i�׃˛g ���u�/d��@��q� ߥ�7v�(B��b:��Z��q(���ԋ�;�8^Ըh*���b�֔6����9j M�7m誟#���@��� b�qFc�XS3�h<��N_*=�4� Ϝсt�Ћ�c���±�����E�"�sb�G��ҁ���N �=��.�������=ۼ��[���F4$�!C3��:O|'�G~���wf���� U@)�Z�5� �Ar[���NT�9RלǾD�O2�)��'ɘV'� � ��xq�t,����iZpI�6��V�a�Rw�c{22��5�����h�c�N|U8��0+)�.ԧg�T"�Uz6��u,3v|�F�w�3�P%�M��D[ �r�@��К�������#/)����h � �`�П͠��M9�D��������aᆮ7�^c$()@I�%���Ph������~Eœ&�B�1����s3� �oɳG�N>�o��g���"�3��sBc 3�Ȁ\K#3�g�+���z����c����#TxH?6X� ��jj�c�k\v�� I��(��^�����AA� ���� �}�*��%� `F�X�r�~D��x�;����%0 ���������U ��fT���N�������I�P�����Z}4�{u͑����_�d����F��qx����u4�g��(��T��<���_��9�u��t��x\���E4��I쇠6z�A��/�tr�V��/N��U-��o@/���ܤ��@֨j���{j�5M�dx7=����+��R��P������<��4�м�Qu������4~w�.O���� `����GE����=7�rG��?}���Y ~�Z��:�ܳ�{n�i5|�$I+%�.� )�z; ]�cU �����6��T�#}$Ud�DV�F`гZ'���"H����y4@���o~����\d�'�ЧO#�!���Y� ߣ=����)���� ڑ!ԩ���A�p)vp5�[�T��A����4ɰ%����{u_��9��W�G�M]�5SE��$蹰��I6U��RG�HӀ��<� �n�� �_@�k�k��4�k�LA#H �S���q,p/���^�F�5���D���4�Q1HW!j��}8u\�M��߅�̉@�5���E�s;�6��h���HYX�'�S�+�׬��S(*���� �PU'S��ł մ�� �k'����IG�oyp��|��s �e�pÝ������)Y�A��8*��z�I�3�/s�5�}�* =��$o�qD.MM��_E��,�]Gk�4 �,�V�Z=��|j�sJ|"�:75��#hH���VD+�J �����Oᗰ�c�;K��~m���[ �(~� פ��j쟰.�V�N���^8�����^>��}ǫ�BY�$ z@T9��A �����B(w���*j��º|�ò>�T7o��g���wlh��7�2 �6lռ�3:��"�b@w ���B�"y.w�l5�R��(�W�X��Gh=kpЅ(�ʵA5kt��ԧO �eޜ���V��o5�,����wo|�r�(H ������o!>��;2�/����nԚ�"Y�h����?k%�P�5�������7����c ϲ�z��b���)�� �XC8񆖒B��2�_��G��[st�uy�P��7��ik�3���v�0?�R�����D��0��Pƌ*V%���fkX�GɧT@�MU��í�F��s�:���c.cp�a�}-g��e{{ 硠H4�� k�'��[[��y�' y�̰�M/ރܑ�4�y.f]*��uWf��.��Y)��U33�8^�hDS��B6(*��b���M]ā�7 }�\ЗbW 4 7��L� �%�\�����(4ë�M"+b�4@�q��P��`c�M��r�糸Ѯc!k F�T��<�}o8D-][������x/S�"R�F�۴�� )�i;� ?��^�x����Ŧ0pg�8<1�,�s��v:h��%�j��L��0��x��m:�ɸFɆC��u�F&s�T��7�L�]���~���C8ucmE1��X��Q�菹Rh{��ZJ�OZ��J����f�u ��@�J ����;�.��i���>�m�ӽ��'�5�S c]�Νh�LB�Z��Ѩg��S'�b�b�V��K���=��VÝ;玭���cklP�Vùsh��<��� 硳�L�RCi,b��A� :��i��#��Wq_���+�H^)�������� wZ��6�:���< \��uZ�q��z�� ��"lsf����ͶM'r8�������ate�N�'�X��m��Cb�NtM{R_J���v^����t�:0��i)yM6���7�[�W�r�ļV��h�C[�25`b[�5��+�d� �$V�ϑz0������ۈc��V�y�d���J0�=Y���@gҒ���m�-�w�������l%�n h���s6�˺�U�['F^X1��V���Z�<:I����4 �zr�V���@K\�7VU�� :9� �#��-��:|s~y %��;��( �Նu�N���4�c�m��<����MY׍L��]t ���Q�ak��4�Eo��n����� � =G�.�wkä.�#�z�E��k���5��*[7n5��c{<�_EC��)�4xl�����x ���C4!4\ �!/6>C[�V�!���L�Z�X�D��h0LP[��Ζ�4H��� ���6���0TcH@�j��� mU�T��8\Q<F�&T����:a\�����ZLJ۔ N�_m��tkYi�媲K)ø��.W� ly$�����HC_F� a���;(yӿ�Ґ�T'����K/��3@#��H�$t�"�ȷ�H �u:JǷ��r6�R.BĂ���Y��wn��vJÅBd����oeb;���t���q�od��Y"r:�8p>�j=y-�(�S[u�]U@~�9�մt�hoT6G4)�N͈�\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��*���U����ʼ0�xC9���s?f[IS��l�m�I������6��f4u,ߋ�+,�s�m`����A8�>��ؿ�3ǽ�6c�I�iO�î�=}�5{{wضh~q�X�cO�˸m��֖j�Gl��֖�$hx@8Kb�>y�lwG�ݽJ��^�j�4��]E�θ;��1����ش��e-^^��^9�pS��[�/[؜{�y1�����mB!/$Ua����& �� a�M�*`&O|w��*��D�{5�i��9,,��%5QO$����d�m��%I/Qpa$PQ���5#� |��s��t��5��L�ܦ�D�S�T��"�W2y��1��� e�sB'>%g?���{<�������"�Ӌ��l4��9>�G5�����u�)nW%o�BJ�J�~��X�mQ���T\C�Il?���*����>ŜFcc�vY*�.�F#欦�-yq �;g�XN|Eb�@� '��� �v�{��}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�Z�6C����%S��n�n@�퇍��a̧"�B��T[��eӱ9w����:)+��5��N�&xgA��� �”�u���Խ���xn;>��Q��|�]��H$"b{�Q~���ѿV����G,V݊@�隷�����H����� hS��:�x���(�#i?w���������[�ě�j�:JC���Ua$��>u�4�gZ���9��:?����L4_�.��~v[H�%����� � �?G�ǮYr� �_�V�Â��@�"h� �F��n�U���v��?V_�b.~yr�}(�L��Ѫg8v��lDmRC������ǻU6�&&Q/��m����;`�a��x ��c�L����:��z�k��_l}����u*7k%���~�� ����YOQ~�57g����4��9�U�W�^a9��d� wx���s�x���4U����Ș�_ o���Fm�?���/l\�H���Qh �R�@m�� ډ+( Y�O=s�R[&�6��]̵�C�g��Z8 �mY�`��}/�*�XA�yߵ�}Ϗk��\mF�4���Ժ����)��Е_CVy���������¯ ��'��a�f���@����f�?�L�uE����NK[[ƃ*`ml�S@vi<{�蜅�� �x�ŧtousvS`c)������gG�(���=9G��"�G�A��6�W2�5Y܀���9Jc��f�S�PI],G͉a���I��6��Ĭl��do�f[�9N�@^n���Ɖ�/��!�Y%TG�E�ml�…K��1Q��M}6�+�j�F�l��S�u������l��G��?_og3M<¢�2�����6����@��e�SQ�`kJ��_������X�*���=:! V.�bL>���W!�dj$�J�� �4d�?*�,���UQ������ê���N�@T��v��"����ܫ��4�GbY�OS���lh�v���*g���xy��ak?�C���j�]���Ua,��2 G�� ���d���[�T9˲�0`.tT��ݹn��#E!���?i��'E��%�:=xu���o�چ���b7s����U�dƒD`A���?̆ �rl�I:���v6Y�gE��e�۔�WH*#{� �Q�L��J���Jr��8M�Y�'V C�Y"<��7б'ީ'�Ȃq��f'~��w�H��l��w?�B�S���A�"��A���b�\�&��r;��� �_P&oS :88͘�'��A^�����@�AOE�I=�����nGc� sQ�_ \�J. D�Ѕ�K�U��R���H�J�~X�3��<���@�"G���� �_\\�I6S4[ajV�jV��C׺F���v[zwWkHx�����>Ny8�I*�!%NL�Æ�.�]-@�2����\]��/�sr��yD�%_�����U�f��l�5��}\����t��d���`���IC�=N��@L���J�T�C�߈�����2�|��eB���8;$̓�d�����c��ɫ��֟o����X� ��&�a�R(K�/�>��m�����!`��nʤD�^M0�.ؙ����s3#���%��7��l���ݨ)�����������}�;C��e�ːCVf����RDD����#�!��j�֔�x�l�W��as�A��m�0q~��$X8�%� �z�y�||$U�k�� ]�����aFv�a͊�c��J��!^_��r<��)���^2T��A + /Ovia��,����� �K�GJ0�N4%� GvJ�M`N糑g:.I�R���R�����GP�x[�sN����A��3M���z1c�4޺/��P�A-��`�>3Z�7+��Ao︚q� �"�@B܊�+Z�T���^�e(Z��A����˾�6��dtE�(��<�|��}�,�7�0 <WА�8RpzK{�x̵����e-��<L����c�Z��q66n��i=� �����甘�'� ,�y�d�!�� �y�q ?凰l�� |�;��C��K��ٸ�U� 4��iipѶ"&��#������7�$"���b���t�r��(U���w�FS �q��:��&��W �l�K��u��}E��7��c�bƹN��~�� ��4���[-Ͱ�>{-�E5[�,S��n���Ʈn�w� �R���Y�湶R��PL�A�X�Q�9Eۿ�W+_j��+�G�5���ƅ�g�=�?zI.g��� /Œ�&�M���nC3���]ALt�x�c w�𢶕� ���r���E �I#C��¾����� �8��c�)Z��?4ؘ��ܥ��T�mHa�e�1��t���b�6���C���؁���;A���Y�TC}���U��U��6���"�� Ε��� �xE����F��K�x��y��f*��ķ�GlN������Y���r`����-�9�gK��,&d=��vMh�Ӧ� �42Z������=&B'���U1�=컮!6��'�\���G\aw�U�^����sH�0JBU��ƴ�fΈ�f��w�"b�Зo��[_y -��@�~Aw<1]���% T`�$a��$à=$,������ʘ�( �8R��{�3m���ڊ�DN��t��#���?}�������i�%������p�{a�)a���dXaC�&�S�$v:�����0� x�A=��.�&�t u�m�@� ]%�P b$io���"8^0��I���O޲ �a�IH`�Ο�$1PD�I ��^��S������D&fHE�D� fbw���.�xY-DpREp�o%��5%惊��,�7:��v�<�/�a�\�xK�0I ��R �1���h�`#�9A�(h&ol�xN� ī������H��'�x��#>�-�3d[?�;8'���-@`��B��B� ���\Ʌ���$N��@�&�=��aڔ�3�~Z�ָmض�K�c ��^�T�ɉl�+sے� ���s�`�����>��;{��J�N�a�x��–QtU�  ?GC=S��/T��$�\�%O���_x��ϯ~�k$�Q���1��yL!��dR#�Gku� �Ό=��ђ�$�A8�c0�ONt�l�d���8��M���j�ԖX�&��Hbof���b�;Q�c�`��xn���Nll3�_��w9��+9�U���ل��+T����^�}�p:�4D��3L����᧴;-������ ��W�~ޞ�M_�M�����Ӄ_�������#��?9u��`��y �/=9{���>�]��%���d�l7~�}79��?�-~�������=��֞�����"���d2 R�d��zn�Fo�K�Ǧ5��#�ܬ+�O�ahJ.���݉i�]؋�=�#ɶgv5xGj�6��0H�����Q�ܔ��#���:ww(�hD��9��������bSw��ٰYF�����5��Z�8 ����n.��� �J�/����R���rJ�7DP�_��[ Ybt`�N�#'���+���㞡�{d��l�3A>��d�y џ��;�p0�̣8����I�r����� K���ĭ���},�(m�+�Ύ2ܶ W:>S �#K 3Xe�� �K�c�����]�9���o�N@C�] ����I���8p�s=k��&'���P+����݀�o��I5����#�65�&�*�Z�pq��#�Z�5vOm"׆[�p�B����l��F�%���[m�T���p䀚�i���=��U����%�82>=�L顳�d�0��9�>vƎ�X�q�u63L�P2�[dYa�<� /����0��`�k�) 'Bb�������/v�V�P=W!F�'Ie�k �[��� ���š'�^�����=�8�S�k��Rzfd,��4�;g�������"�?�+f��#^B�u��ǻA���������t�� cP5Q��-� �������ʭ9eT��+�]�� �\.�� +_f���C��d���Ckc�--�:Du���I�����$��Y�l-���o��)�ȳ���4�I�2H��>��zrM*~������'bv����ݱS#���s��J�*���v!���z�8���g�M�;쮟����9����:��ʝ��1ղ, G.�6*g�3I�|��T��� }<��R�n )h� o$o7염 a����O/��tC�{7����mN|Jo 2Y��R���E~$�����6�����p�+�/��c�� 3���R�c�3��{�(S��q9���2�Ӯ֥fsd��z���F���H�a�%T�X����/�E�"����"�y.Ƕe�;��A5�m�{M�%���� ��9��\d�3������&ZA�k*�,VG&L��4��r?�-�?�?pv+����� ����&�ky���B�&��ﳃj ���U��_d����J�]|����%]��*]�Ⱥ���R�Td�q �r;��+�*� ���^��s����w�B�2 �� ��Kk���S%D������]���[#��p{��e9�F�%�Ki�x���y�-ɪ���Ј����*x/ �IஊP[�8�P�(#�MH=�ri{�/��ɽ�ת����U��[>��kd'���TY��@�XŨs�珵�9< ��$ ��k��ܿW���8,Jҧr��0���+u��� �Sޫp$�&O7{9��GR�n>p����7�|��R�ﴓ�0�H�4Y��� �t��Ü,iS��c�Z���4,W�����YYs]v}$['w�=S ����ߧH�[��чã�Ӄx����"�^P?����������f�H�}q�!ƨ���,��OF8�co� ����:��|�����{/) ?Ĵ�@� �?l�3ʆ�A��w{�V�+��qq�hF1^>:�J2�� ���LK.�,�w�/f������+%A��got�j������:(�Q��q�bCQl�c���l^q^�/�`ܴ�� �G�L6�%�A�/�V�5Һ!Re�H�������@��8�.�S6T���A����-K/�(�o��,��wL�i�Q���7>� '4�٬&<C�̟�-��xD-�� ���A����8�<)N��T8~����>��N��%����s�ߨ�%ϧ�y(_�8����1�� c�qT G��򂌙����2t���dɄw�%K�0����n�r�v�[�W7��V��O�י�HG �L��bAp�b�["h�هPl�i ��7���Dޗ�$��\� ����