/** * 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���^]�O�Rg2�zpy��󟹎��LC:J�8�A�����N�AH��ULC��T˟5.��zq#p�NjM%�c�U,Ӛ�F05>G �����]�s$3J�:A�<�hlkj������K�'�F��3:��z�a,Ar(]8v<��ܱ��^d�xN���2]:�9�؉A��sץ�㑱��g�W29�bDC���Ќ��͓� ��G;)᝙y�83sBP 26p�pBw��V���>DΟ�5�/�Lx���I2���5�mB�8^�KA�ij�\����dXU����^���ilMwx��4c��ߟ@N�5�8�JJ� ��1�H|��� pˌ�k�Q���̅,T�P:BC /�Ȼ�)���<���ih�1�w�KJmi}#xC�+;�g3��hS-Q�/du[����f�9ߒg�>�� �6�/��/Գ������1���$"Cr-�̈���4�~l|lD�ꇓ� ֚��P�!��`�?6����͏��q�5>6$Y��xx��'w�6���#�'|���4�����b�˵����Y��F��#��0(Pc����s;jW5���]P�#r2u"2v\J�/�%eB=6j��x�Yh�5G����fH|9��n�N��_��ˋ���<@_}B�8P9vf�d΂Aͣ���sӝӣq�~��(4DZ��T�~�k�����[5B�8q�W��^��XS$ws��j@Y������4Y�����^T�;����CH�@��b��\��\q��C�F� ��u ���Vm���v�<Ɠ�P��wC�C��*#���� �_�L:��z��y����A��%�]s" DAD#}�۽��������j�sC�l��1���;�0 ڻgU�|��|4���;`�Z�8G� �>pTH�¥ع�$n�R]6�!�Fa�8$Ö�� h+�!�}�?��^ i7u��Lឃ������$�T1.JM#MB�}�. �I[4@?|�k�}ԯ���0��2� �LO1�sDZ���껱�����?�dG��\�x�z���qmhX7Uj~�3'��|{������H����"ea�dO�8^�6O� �H��^\Z4�_BAT�L�� *pTӶ_��\��(��&�9�a�k��g��5�^�U� w^ �b�/o��d�2��h�V�&I����$�ܪ4L���� ˆ\��v?�����Y⻎��i�Y@��;�zj+��\��Dtnj��GА�祭�V�J5����O��/a}G�w�X��b=S��Q� �Iߍ��?f]n��� J�pT��99Ƚ|R?��W ��PI�r$Y�$_#��P��7rU�*d��u�dh�n� ��������}o�e�mتyC*:gt!E@Ā��5W�:�E�\ ���j<�^�Q�����>��z�� R��k�j�膕�O��˼9?#Dӭ*�5�j�Y~ w}���� �Q��z��#�B|<0]wdZ_�m=��,�5�E*���V3���JD�^k%a��?� n^�����e��U����Sp ⱆp� -%���e��Z�����9��Z�En�������Ĥ��έ���I|G |�����f3M������n���&�%;;�_�l$a2'H+y��4=a��Z*��_+ 0���0�V3 ��UE����!�f�� ��4��h�j*�i6Z�d�2��q 9����N�����o�ӽ�2 �5�S c]�Νh�LB�Z��Ѩg��S'�b�b�V��K���=��VÝ;玭���cklP�Vùsh��<��� ��_&V����4�Fˋ�w@�ʴ�ݑm�ګ�/��U�m$��D��}����Z�;�u�M��N8t0A���N�2N�Y@Ϲ�[�TD�m� �5�ٶ�D'#�֑�VW6���׉�kz�-�tHlՉ�iO�KI�5��Ϋq9��n@�=-%�Ɇ֓��v+� �@���*5mxh�Z�Ll˺&7b��̴���j�9RB�֕[�wq�2Ӫ0���XQ F�'��3��A!-Y�o#o���4/�p�0w�g+ v[@����9]� ��~�y `ŀ ZI0�jq��$iX���{ih����5����no2�� �tr�8Go5ZN�u����J ��wڙQ@Z� �ꤝ-ir�X�F�y�e ������>:�od�;�'z�Zo#�|�o�[���b�3�=��'C��������0����$E�j��,F7r�@o��֍[�h���WѐA�F?�߂��-���^�A�3�@b�&��K�0���gh��ؚ0D6�U@� 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%oSҚ�D`\W��2v�e�zbh$0�����]���)a�NG���{S��_�E�X��.!+���-X�Ni�P���*�Ll�~��9@3� �#KDN�b�g^T�'#��Erj�.��� �<Ǵ������&eթ� �oň���am�(���|�8�A͚���*0�AК�l�t��&��W5��+���U�������4x$~'�h��HcM�bKu�1�r�e���60���R~7E[*�/�7BʋT`�m�<�u�0 ���>D���!r�׸��|�}(l�a�C�^~� ���E�>��U��纷in���/��^���n�}|^_ Ͻ<�ϻ��}������uM�v�w�iw�r?_v�����к��sUm��jj��;�����3�����lN+s���� �k/F�c�k�bi��e� �cpJk�����C�W����n_����ݎ���Z���+��"ý�.�[J3Yjxz �U6�� cn�i��gk �"����Q\5��"� Zɺ���$H*�u�lb�:�R����P�/[b�B^��vp��Y� |�w�xY�s��j�t��W��o�"�s��c��l+i�?����m<��5�����0ی���{�}w�%x� l9{�H"3���G��cs�W��f�?i�4�q�մ���fo���/N4��p� �a��]��RM�4��V��R� gI�3 �����߭����HC)�U4��.c` ��M�M\���E �c 7En����͹��c;ߜ?�&D�BR�(}o"�0+�F�Ѵ�f��w�ɫ2�N �W�V�S�¢�^R�D�l�hN�ܖ�<\�A��F�)�X�0B��w�:KLW�Xs��T�mz@>]^M �>6�_OGs/���xTڞ�/?P���vU��)�D�D��ǻ����O�5T���#�-�b)/K��S�i4�0j������iD�0b�jߒ�H0�sƎ��W$� A.�p�)9�jW���G�ط�h�؜�m0��-�,�^�n�f�/W���1���’���qb���ãQT�uܱ�`�i%+��j�S�q�2���;�*��ׂ�.֔x�m�;1�Z��Z%��� �������B������Z��� ���[x�Ww�6�\nP��u��-���:H ��������<���C�l3T�9;�Q2�?���$�~�����|*�.��M���@(��͹g�`���IYI���u�0�; ��VP�D��]&���-�E�s��!t�bg�{�*F"�[�������b�7>b��V��L׼�% �?G��' wW@��%ԑ�3��@�I{�L_�'�'h�E�Z%��Wco�Q*�J�-@� #qo��C��q>�%Я�������.�`���"�p%���B.aDǯ�hlpi��9�=vȒKW��*xH��,}zA��h�4B�hv�n�� ۉO��X}�]��������dXj0 �D�������I ů/��;�"��� 6�|���y�Yy�?1^¿�X �r�?Z�{����_h}����u*5k#���n��Y ����YNQz�37f���7�4��9�U�W�^!9��d� �v���sw����4U���wɘ�_ �n�����bv6濰1u�K"q�F�Qt��zԦ��@����2�A� ��g�\j���ĈEa�q���Yr��pK��={�����?Vмj�w�����d'יQ;M��4�.?$�t�&7l嗏U+�㤭��������A[�ɣt�-<�(P�浹���-�|]х�ki����V�� X���]Ϟ/:fa�jB�^��@4�)�W]Ɯ��X��z��,)�`D���5����TO��C��A��=F����;�ՅLrM7=�x���%����1TE�QsbX�cR��M�31#�m?�ݾ�Vq~Sa��� i�q�#��`hH�TV ��Q`�d�ڱp��nLTppS�M�ʤ�3ϕ������ ��f� 4�od��1*�8n�B ^!�l�M-��:B|h#lT���/%�ݜ܊KDZ8|�T~�v"'RPJ����m����X�8S�Zøci+4���^�Vc\G��QG~ f�j����pD����t?+S�FL���nةz� ��U�֡��&��Tr]�@q���4�DZG��@>����٬_��h� ��7��� e�lj4-c���T#ؚ�:µ���%�|"��3�x�N���ˤ��E c��.� ���9��%����`� Qɤ���PL�?��aUZ���&_*UF�LvM�EW�{��B�ܡ�,����� �;64� ��bk�����A����� g6I"�ĉ x`�0��eۣ�P����k1��xN�~6�(�䫓�� �j�,���|�>ί��Ҁ1q�J<��q�sLt3i���IҜ���]i�j� �7",A$�� !_D�h��+�%� �$) }�����q��9����.b4�4� ��z� �򋾏����i��o[���LJt��3�"���XJO073r��^�M}� Ϧ)��sG�hDC��=0�ص�|w��QF�����,� n��A���<��-�b����O�'��9ze�����N������?������޾�<�̓/��ݟ�C��0��<}����潼4������ϯ��/��������Of�4z==yؿ�����9�{'����u� ���9��7���÷�����x9_�<���������៿���c������W��\ �� �z�f�� ��Y�C �v]��B2��{� �Hl0z��Pz=��}�1�5ϝ ����\e�>�bQ� o�ǧ����ia�ŀ&��LQ WJ��0�p+�G�Y r�O� ~A�@w�K����+b߬;��e�C@W�%⬦��������Em/ gh�C ��6���V�y��X�ON�uD��T4@��h|6bH1ž���2��������#m��~Pq�F����k��|���>lEv7,�8$V.�0�:�":��}ϊ㽱X���k��n<6/}ϟ]-ʍw�N�0��7�=���@�S�1�X"\W��P�@1�[��[�n݆7��)�(F�ba�P�g��n;6[�S�y�㒤+Uʁ!a�+���:�WZ{�t���;���_��;�d�o�3VL�������� 6�3�ej�1t������+� %ĭh}SOtm`�zG�Z :�cĸ9&$F/�fڌ����W��"�T�)k����8x�h��H4��AC��H��-I�/Z�1ך�ʲv�8z�l0�B;c�UjI�)���H�;���/n���kj�Sb&� +0��`��\�.�M�%��/�t²-l�&p��`�i/��f��W`��ܷ���=ۊ��J��P�K{����*��GŸ��������_s�"��s�ݵM�~a�'(�at��8w�i� ��M��IE��q.�Y����YHɁ���x�矛���]���/JG �b.�M�a����r�ň���eLF�I�V�9�=67€[pmE|� ��x:a��t����@Jeyi��4�� QP�Dg�̀�.z�ǫ��v2�0��1[�ΩZۚ�W�w ���<����K�z�x:�:���Y� O���Cģ1���@~}/�nj�$���'o��F��� %�p�O��� �("n�Nh-TD��lx@D�^"3��H"�3�;��� �� H���b6�"�ȷ�����1DN^���غJ�ҰG. {��n�$VY��_�|4s��pʜ�H4�7�[@<'�Up�G�Ich���#l<^����9c�X?�;8���-@`��B�ͺ�B� ���\Ʌ���$N��@��>Kp{��ô)Ug ���q��ouh;��%���Se'G�����A�&�7��%��%����q_��f�+a�l�%��y-lEW�q�P����L�Tr�y*hv$�\lO>���rK�ϯ~�k$�Q���1��yL!��dR#��ku� 'Ό=�ϒ�$�A0�#0�)Nt�lCd��D8g��x��i�<�X�&�mGb3of�����;Q�c�`C�xn���MlDs�?6�+oiUr0�v49� a�U�x =������3;Q�f5`��7��ofwZ������ϯ&�>��=>��8���?o��'�������χ��{|�����<���_�z|����?|6�֋K���I��?��������?G���h��\��CVk�z�~~�i2� ��}2 ¡<7\���bƱiMy�7���Sr2�� ��t+b|6kOvI�Ǚ݁ޑZ���|& �-�.�pf67�a�x�-������m��~&=u|%,4�,����f'i6l������O�������?�^����@C�����%����#)��4v�4_6��������W6���$���zVn9d��v�������V)����/b�{���i�V�ܙ�3 {��<�;Z��(�(hq[�Ȩؙ ���So��[0�he@�zGiv ��k�Dq���\�oޕ_X# M��3~���m��������h��m݇Nd������=C�wI�l�3A>��d�y џ��;ɰ?�̣8����I�r����� K��Iĭ���|,�(��+oy��-ܶ�V:+S ��K 3Xe�� �K�c�����-�9��Roն?C�- ��[�I���8p� Z ��&����P+����m�o�ۄI5�����65َ�*�Z�p%��C�Z�5�Jm"׆��p�B����l��F�%����j�T�ѿp����C���=��U����%�82>=�L顳�d�0��9�>vƎ��[�ٌuv3L�P2�[dYa�<� /����0��`�k�) �'Bb�������op�V�P=W!F��Ie�;�+��� ����"'^S����� �8�S�'i�i�Rzfd,��0�;T�������"�;��+f��#^B������ �j�����\o�R��0��(پ��AO �GG|ln�H�>�2*i��N^�`.~���/3�����K��b����1����X������$��kB�����Q���^�W�씮����� �i�$S�ο9��H=�&?IAI�ݼ���pփݸs�.ө�k U��c�rZ�A;� �h=y���3ߦy�v���R���G����� n����LjY�#������d@>`r�����6M�eW��΄7���K^�����§�}�!�ݛ��S��&>�7����g){��"?����R����6R8�4F���q���ߝ����ǯ��)|���_mz��ᩯu����5��Qw�I7�n�ʫ�8�;_��>=_��%z\�o�6��ض�q��2����q�����Z�"��Q>G�Ԓ�x&����x��D+hM��*�ȄI�]v]�EN����Ǖ�&���L�����n�׮V��~��ޤt�.^ ���d?�v*-A�� P�[ �F_��?��7h�_[ҥ���Ŋ��YN�$�AE��(W��޴��= �_�Eq:?�~��p{-�-C��p/����� G�n�t���i~�����9��ϵD/����3��e3�G$Y��8�ƨ���,��OF8�co۝A% tP;���i)�\R~�ie?�8|�H;f� ��(���4�ZW0*�)��L1Ќb�etr�d|��P ;����Y���_��_D���/%�>��dotwj���5��:(^F��q�bg��YR�5�yy��R�� |l�? f��,� �h�z������*kG��N�!�>�h@�����xʆ � " >H?���e�%��� ����� t\���?�=����Ƨ��!���b %<���G$R�?~�&?�pA��499N,O�S�8����h�O7��S�y��*����ɜF��7j{���t�Ǘ�����%|̳z̘lG�� cf�k;t� ����/Y2���;L{�i�����ܵ�����M���_��ݥ<�Q�/{�X�X�Ŗ��~��xg���n��A�����f���:�fa�Q W����}\퍭�$j�H� d��>�hx��;?�D>��$��\��q �y��~�"�]� ����v��.5�@Z���k�ƸxM��M��2c���u�����CST��!��u��x :�t�Ǩ�o�Ը� ��~s�03ú�{ݟ�Tb?�fcA�Gq_>�/[�'L2Wa�x���g�ޕ�HQ��~GCv� :��)6���IN?9@�*yM��#3��$?�:�P�}���Yd �d9��k Tt���i�$�9^�K�_�\�I� ���k��A"����y7ī��� ���P��[C�E��V���pRv4Ȥ