/** * 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�bDCbh2�o��58p��N��8�I)���Kř���N���k���Զ2]���!r�� �9�}�8�d�S�O�1�N�nj����X � HSӴ���m�'�) ��*��p��"ddLck�ëo���H���j0p"�2�aVR2]�Nό�D��l��Xf��^#���.g.d�J��Zy��@��l�L�5%OC󏹿K^RjK�[���_�؁?�A�E�rh�r!�k��� ]k��HR��1B���(��0�J�-��=��zt9I�'�ncz7>��f�=ߒg�>�� �6�/��/Գ������1���$"Cr-�̈���4�~l|lD�ꇓ� ֠��P�!��`�?6����͏��q�5>6$Y��xx��'w�6���#�'|�� �4���!� �b������Y��F��#��0(Pe���s;jW5���]P�#r2u"2v\J�/z&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�C�����CH�@��b��\���q��C�F� ��u ���Vm���v�<Ɠ�P��wC�C��*#���� �_�L:��z��y����A��%�]s" DAD#}�۽��������j�sC�l��1���;�P ڻgU�|��|4���;`�Z�PG�8�>pTH�¥ؽ�$n�R]6�!�b�8$Ö�� h+�!�}�?��^ i7u��Lឃ������$�T14JM#M��}�. �I[4@?|!l�}ԯ���0��2� �LO1�sDZ���껱�����?�dG�]���z���qmhX7Uj~�3'��|}������H����"ea�dO�8^�6O� �H��^\Z4�_BAT�L�� *pTӶ_��\��(��&�9���k��g��5�^�U� w^ �b�/o��d�2����V�&I����$�ܪ4L���� �\��v?�����Y⻎��i�Y@��;�zj+��\��D�tnj��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����M��Ĥ��έ���I|G |�����f3M���O��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{�T"3��է��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@<2J��*%��(��:f�/R&;�t�Sr��<���>>]^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���’����b���ãQT�uܱ�`�i%+��j�S�q�2���;�*��ׂ�.֔x�m�;1�Z��Z%��� �������B������Z��� ���[x�Ww�6�\pP��u��-���:H ��������<���D�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ǯ�hlpk��9�=vȒ{W��*xH��,}zA��h�4B�h�V�� ۉO��X}�]��������dXj0 �D��������I ů/��;�"��� 6�|���y�Yy�?1^¿�X �r�?�¯�Z���Z_y��� (𿝸|@ff����ɥf�N��=�� �������x�E#eV���m(�g��)�h�,7���֔���$ /��S�U���[tB�\&Ř |,��Av��H��,錍� �@K�X�J�UE�b��I���b�7��P�2�e�k�,�R�s���� �hB ���0�eCӞ��-�V9��|$��e [I���V ���獭 c�7�I�8B�����w [Eg�؊���!X�%`�s��J����uC�) y�����q��>)�^.��������� 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����BM����� S��W��լ��5�-��m�ݾ֐���� }��pf�T !BJ���� # ]�=�Z�e�񫰹�s_����g�K�>y�;���̢���g+$�|��, �����7>��D71���{�&�Y��.��ЕV��ϰ#�DR���E��� �_��0O���7�[�m箞�;���"FcM�⛬�a �,!�����o��Ǝ���`��nʤD�^M0�.؉���� s3#���%��7��l���ۨ)�����������}��B��e�ːVf����RDD����#�3���)��<$?8�.�֩�f�A��m�0q~��$X8�%� �z�y�||$U�k�� ]�����aFv�a͊�c��J��!^_��r<��)���^2T��A + �Nvia��,����� �J�GJ0�N4%� GvF�M`N糑g:.I�R���R�����PxU�sN�����A��3Mf��z1c�,ޚ_-��P�A+�`S>3Z&7+P�Ak︒q� �"�PB܊�)z�Dotc���5Р�OX�{ه�ft�����E����OYC�� ����F�F����RG NnIb�����TU����ѓg�%�{�RK�a1��F�m�)��|uÖ�^S�3�vX�C6 �L1�Zwaq2/2�����!`�7�M~V}Hx�u6��d��=- ��V�L�Pz�.��Y�w���֞D�:@³3�� �m:a9pgB��VS ��R{\���%��/�1�[�Km�b_��� k����q��kk_l+���g9M�б�봔N��)�Q�V��f*MKo��������[)�^�Ƭd�\[��u(�� U��(Ʉ��_x�����3��t��}#ǚM�m�*ڳ���$�3׋�ƅ1�E��&���74�a @(�D��=�pK/j[i�� +g[ !]��U�����|a�HJ�@�_�� �-�p�l�|{��FZ��v�0�����l.�|�o���m �bg�@h�5Ɉ=����P���m���*�m�l���Xc�m����k{�����a�C#������c��4�P1�&��(�6bs�L���'��=�;=��m���Z��d� �}��[B��6l�1�|��ve�1�W�7I��zHX ��#��^�1Q$�Z���������a&���鄥G��)�{�)�好o��J� *DAi��v��$R����ɰ� F;l-:�jI�pN_-�48Q����̼t�7��C��n�%���*9DhZ#I{ ����y��O�]�~�mt��:�P w���M� ��"�j�4��BE�ʆ�%@��%21C*�$�^0��H���H�p���j� x�*�|( ,Ю)1N��e ������|! {䲰�[�IR`��Z����G3 �� �DA3yc�s2G ^G�p�~�4�F*?��#��]m��36�������s�@�v�k d;�K(D���q\�͕\8>?z���j���������������z�� �����|Ȟ���'���̓?Op��ǧ����g�k��d�o~��O��s������o�s���&�ϵ��8d�������ᗟ&��p��'� �s�5z�.!f�֔w�r���?%�D�)�`�K�%��wa��d�$��ٍ8����l�g����'hs����� ��]ܚ�V����`"�S�W�B˒�M �av�f�f�O���y�O ��!�s�ř  4� �I{�_BG/�?��?Hc�I�`CPx�꺺��|e�J"lʪg��C��~a�in/�*����u��D��覰މ��"+|@�z�63���Zv2����-. �n0f|�������Y3���wy7ȼڿ�wq�W��T~O �&J���o���C����6R�'��J�{�����!�˅~a�ˌ��~h���=�om ��%V���?q<6���ڟ�d5#=���e���E<;��xv�>��fZ#�T��/��>YO�I�ORPRs��D�.��`����uj�C�A��@�\����#D�4ZO����̷ir�]�>0�=�~��&�[�s}<�Z����%w�F��X&����2�d�'OSj�� �3������!�u����E|�nH}��0�T�ĉ��͠A&��Y����ȏ�������?6�=N|% ��l|\a��7i}l|����c _5.#�W�^��{�k]j6GƸ�w�no��G� �'��*���~��y,}��8��s9�-c�� ��ms�k�-q�V��ex�ϑ ���*� 8���&��6� �_S�e� 82a~�]���ani�q� J���?S&���I�[��%��7G����7)�Ƌ��7I4�O���PK�E>8�T��ߗ�w�� �זt)�t�"�v�f��IArP���1�U줷��;PD����zQ��Ͻ�{G#�j qː@77�Kn�)>O�`:���cvs��n���µ9 ���w�.��� ~��!b�$�FjlO�C#�g{K$�ཀ�&��*Bm9�$Cu���7!� h˥U�[�$'wSpg\��c�Z�WY��/�C�����vRe�UcI��=�?� \��$hn�$�F� �m�F�I�ch�(I�v�M���,� ��AN�+�Oy�‘��<���l��E�����v�����k�Jq��Nz�@#!�d�'��c,X�9 s��M���g�z����\����C�ge�u٭�l���L)�� ~�D �oɳG�O�?���fH� ����s-�K�ll���q� �I��/Np�1j��{��&K1������vg�_I�t>}�C �u��bZ� ��6Ҏe�� ���=M����q��8S 4���\%_�b��^�%�s�;�3���R��K� ��ݤ�+�pi2��W�/i�ؙ(v�c���l^���@b��i�쏂�l*K|��@2��^k�u;:$B��ڑD���cH@��l���!$�p1���.�H��O�7�hYzIG�x|æ?di?��c�Os��?.���nx8�A�f5�Yl�������Cj��O��.��&'lj�IqJ����s����F�p�?/_@T�x8�ӈ?�Fm/y>��C��2t��1^„�yV�3����h8^�d���|m�ΐ��7�w�%K&��/Yz�i�0-�4�u󗻶�^�� U���+}�ǔG:j�eb/ ��k���@��>��bO� \y#��2(;�*���{Z��,�7J�y޻�ѣ����u�D C]ɘ����  ����g���dP��Ö3��A:�ׯYD� q�5bp}�N�Х&H�Ғ|m��� ����Xf �Y���a�Xx~� <9�R��:��A瑎������T!9^��onffX�w�۴�J���l,�(��g�g ��I�*�Y��­�����{S)�7��hȎ�Ag@�0��U�5� �'�_%��zdۀ�'XGj��0>�L��,G�� b��J��0z}�Wd"2�{�pe� ���3 \�A��~ R4#HC�x�7�x��r����N�����#zk����(�7ۊ����=�٤