/** * 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�� /[dB\y�Le˒�\l˱�dg�h��A@I���:�0O�v�b����/���ƍ)RRr��ő���uuu���������S�`��!������S Өi��gQB���� T���)��j۸jU�&P^ �1�D�Ⴢ �}����PwT�]KЊ��Y���Z�����,wf#��K`d� � ��� �-�����>��9�89.%�݉<� ���h4�,4ÊS��fH�ZT��I:�*�z�s����Y���Fqԣ�ؙ“9 z�^�c@\U.LwFOF���~D�М�~jS�K��W��O�'o�=���+q�zz�&H��&%T��F D �S+�h5����p� �{�Z�\��s��sp�u�0 �y�*c� �x77A��X����=x�O��⦺�xz$V(����+��z-2i��?ğn���g���K��X�4rͱ���qfw����g#��>� M��w�l�i%ذV����{TDk���s]Z��HrէO-rր�Æ��V;�l䞛�gZ�^�����/�K)ͥz; ]�gU �����6��T�C}(�d EV�F`гZ%���"�K3Ϧ#ǃ��Q=�?"����r���Z~@�>��;�0 ڻg��|��|2���;b�Z����I��(� �K���Hܒ�j��h�G=A� [�]_B[y!�ː�1xw�{��Tk~�b*���v~ �L㙾��4R7 :����u@��^��G���@?��Y��$��)�|�8��]Uu?V���BP"x�GZ�Q0xV����}4q\�M��߅�ԉ@����E�s;�6�jQ�o�5a�j�"\qԿfm>�@PQ-{{qe� ~ Qu5ʼ��XP�������z�D1�����g_C� <�~�����n��ZBs}y�4%�>h�y����B�0Nz�eΨ"����V�~�'А�ͦC�Ҕ�����?�rߵ�FG��j%ߩUS[ɧ�:��'�\��˜} y^ي�hI�BC):���S�%����ˠ�C[�f�?�߀�A�黑���˭T�� ��B/Uk�L-Ƚ|R>��W ��PI�r$Y�T�FzK�� 6o䪨��R ��kH����y+H�?k��cC���)����a������A��[��\"��f�������� k����f ��>�_�6�d��_���i�|�7�G`�h�e%��[�1�_�]ݿ7�G9d$w��x���[��G��M�K�����%�f�HI3�r�����Q�� EIXh����Wr���1�g�{�G1vx��¥x� �xCKI��`�R�#���[3t��ڊ�H#n����0 g�B���y4�4�#����g1�dM`h�ˠ�)��(J���͢�⑚G�'@�uE��í=�F�)���:�V�1��18�0���3���`ww燠H4��ƼF�'׻;;��9����ű� ��k�w���x4�g��Ejݨ���>7!94mg���\��ki��m w6���ʂ:�*J��&���JX�����4mCL>�+�Ѥӛ�k�l0�_�l$a2'H+y��4=f��F*_�20��}0֖e3 ���Y����!�f���!�{������F����-@k� $g�BNo�]໥vׂu�G���Zc�����Zz��~�a����̉&�8D���;�"��r�ĠR�V��R��t��1#\�c��r� �±吂_yl� j�r8w�ןE�X�7�<����Z(cb(�E���"�]A�2�x{h[��:� �0@�:�6�WJ�l�Cm}d�Ý��Z�:]Q':������aS��2��Y@Ϲ�[�TD�m� ��޴���f�U��a�kz�hO0��7�����*�5�Iu%�E g��j\M��ЁvGK�k5C����v+��@V��:5MxhִL �ج�H܊N2�k���H =Z��h��ۈc��V�9G��N`M%�NM���@� i��n�6��H�� �2sg�l��`��X�9��k��U߭#��PA#IF n�$ ����'M�N�}��@M�%��ۛ �*Ck�����[��Sc�9����b�ff��h¿*i&�AKZ�ell��,����������.:�kd�[�':�Zo#�|�o�[���`�3���'C���n�����0����$E�z��,F7r�@���֍[�h����Ѩ�V�n�� ^[j���4^��g �,�u Waȋ����A��\�lZ뀮����Q'? �F#��U u�j�i��&���Js D �X���R��HS�Z% ,�eτѿ ��c�C�N��jD�S��ZLJ۔ N�_M��tcUi�岲+)ø��.�� ly$��Wk)`������ ywP�w9�!�(N�5��K���c3@#��H�8t�"�з�d�u:JǷ���l�%_���� ��܂픆K���-�ֈ�\T����2�c���a�jd���P ���ԋ��d䵴�HNm�EpvU��瘖����U�Ѥ�21#>r��� 3���T��bP�!��b%�� hCt �G:H�O _�+�7ĕ—�*M7�[Z�v<� V����HcC� �V�zk̋�VYD6.��,�B+���B��xy�R^�#o�^�K�`� �Cdc�p"�{��`�̗܇���>���w�����^4���_��x�{��6����m���O�6������˃��; �����>�X7�mw�|�v*��e�'��� ����;W�V>뮦�����(���;�X�nY0��2w�_,���b�&vX��p/�6!�i{\��p?������/><${%��l��5��������в��{�Q��4X\d��et+i&K @/A��qq�a� 1���l-�^d24%4����SDUB+Y7��I ~�n�M�_g[@J0.�7��˖,�\g�BV��՝1^������8]&��� �7d�ә��1�c��4՟�f��6�t�����ls�mF��辻�u%��%�����!gG7(��S79w���G� A��.�W�2�5Y�L���Hc��f�S�PJ],G͉a��H��6��� k��d�fW��J�@^n£��I�/w�!SS � �*� $ۤ�� ��:0Q��M|6A[#��y!G�F{s���*������x(�㨎� �x �L�56U���i 񡍰Q��|!i���]:��a���c�9��Rb�LLlKeL�F:ř��F-K[�Y���2_�q��[D�1�������I��L 1��O�a��-3��WF[�>F�l��S�u ũ��߅�;�=� ��C�|������8�FAX������,�Mu��e��ܘ�b[SZG���4�$�O����,މ�`�eR� ��"����b�L���D8��% �H΀ �����d�T�a(&ܟ��,-�q��/�,TFs��"������R�܉�u�OS��wfh�v[��:g�������^҇�&s�»0�yc+ø�I�8B���N�w ;Eg�؊���!X�%`�s��R����uC��2y������z� �d� �x������rz���3� a9;�n���8�+���#������� ���2j�t>V���x� o�cO�SO6��$��4�F�� ����E���Cb����r�0t��6�z9�������0z5��w�7�-��VA�*2�@�n�\�� �0+[�1�"*R$�����Hg��yZ �tR-D�<2-:��/%*���T�l�h&���,��,s5ˆ���zC�z��ڂ�c�8��Lǩ@B��81 ��l{8_�e�K����s_����g���+��x�۷����t����}�( ǩ���7>��D71U�=Nz�@L��rc��ؿa ")_f�"rI˄\�/qvH�'I��ݝǶ�ST�� >ߔwÑ�A�M�ðeM��_�}��6LMc�y��@/�`7��D�^N0�.������Dr=#���%��7��l����hq�[�h�W��]+�w�y�xꯦg�`��\��f�s������o?�����蕭��;֞_D������/G�~z���3 �8��r�͋���z����+�{ye�=�;���_�^�^ֻ�����?�M�i�zr�&������9�{g���q� ��7�x��7��������x9]�<��������?����G����_��x���e�)[`���*`6�� ��%��8��pn׋�]H�^���� �B���Ko��ڸ/:�ܷ�3f����+��'�P,*������4:-��p�$�) �Jnv�ne��6 D����n�t׹ԉ?Ϳ"����\_6 �1Dt�Y"�jJ?�)��\��p�f<�p�n+i�!n-�E��u���<�D�V�AEt[��73�CΠӋoSOY��������&�v��m%�X2�TLq��F�~؊lo'XHqH,_�a4qYt ���{`�89�7��j�.xl^��?�/ˍw���0����=���B � �C,n*�K(F�yNJmRۍu��nK��Q6�H#|���[�7��m��-�-�)t�8�M7��3���I���l=����� ����m.��X��2�4֦��""��D� ��F����'����`��oR����!�ۮa����M�p�Kl.��z�v��H���.�3t�����!� +��9�+)?��x}y���ۧ�&���2�@���"d�&!��"�jLm���Y$���D�4�(�MYDE����@�Om<:�;� ���/M��I2q7ыk&䊟�����XwL�I�)]�:- �A�w\-��_�/�&Y�e�}�k�f��k���i�A�dz3\�3�5�`8�3�d8'�b ��a�f>e%�Qq���H��P����*�q$�t�$v�,�����%,�w<*��2�c�Z��qq6����U����-���%f���#lv4��]a�0/NL�G��-�=�� ?��1�*^+�͑�/�Ѹ�MK��e1ߗaۤx��=zǿC'1A_�p0���&��M$��1���ɩO �Q��5�����zl�I,���svE?�w��#�Í��\ X�b�?����4�n˴�]�.��n� Z�����h��N�6�t�]T��}��3[���PmyU��-H�,r2�g��b����C>}w�A�űf�d����,�G���/������q�E pYg�H�v��f��B���\�^�X�-��m�%�!��m�B�H�]́�Ќ���S$����/���@��Xn��o�Sߞ�TMK�l���8[)!���j���]?�Ճ~؋���`+ �)�Ke���{��)�mTE��⥈O�}�����X�+-��G=S��7���!��bOu�-0�j�X�}>�Ѯ� G�u{��"g1��G�� I>TX�`8�>>�g��$�B���*�_Lt�l�d�� D8��M�}[��X�%�9b� of��Ң�;Q�c�b��xn� �~�0b����Y��#�p�`�m�q�c¿�.54�|�Ӳ���U�aRo����n5jί�O�_j?�������|��||x��������_�?�'�����������������_�l��W �����y7~�}7>��?�W��j����s�}4 Y�=���y�E���x����,���p�N�M�Ǧ5��� �Hv�{JM@Sr�W��K��ž\��>I����^�;R˷ـ̈́�%������ d���й��S�)C#ҕ��X���/���%����ɖ�2��I�ړ�<>146d燲�h�@8�ܿ�~^�$��ޓ� ���������&�'�TT_QSV=kw� �K�0s[����Ic!�o^�/bd{��I���)ݴ���N�<�[Z��0�(hyǪ�(ٴ ���So��[0�h�G�zK�� ��i4Dq����\�o��\�/����R���FI�X������ܱ������Nd�ؗ����C��I�Wo�SA>��d�y џf�m�?��gQ�����d������� ���3w;;%{�X���nq7p����ը�c$ !Cv�a�a&�3��p r�9�K<�[.SX-�g����o��NJ�Ň��c���dM���C�7j�����1�-7b0����xӦ&ی\&V�.2�#r���˵�.�m��r NЕ���A� c���bݷ|�iy�J����S7��W�'���5����GƧ�)=t��L&#A:������1�C+;���Y�IJFz�,�,#�'��������p-:aa@_�DH�_���!y��e%����*�h�4� v��W���.��"�\ᗠ�j�dgW�rݐ��Ma��pC�қB�L�׳���k�I�k�o��T�� N<�z��?�ט���5Q���?~���`L拴���զW�ˌ�Z����1��m����ݡtî (���#��mV�+�E>����*`�\�l��: �jz�u�zC\%�)r�s$H����g>)����M���7T��X�0 ��n���I�l�t��@!͇�Ϭ�����խP��ҋ�O~ڛ,\5��_�+��O x��J�E>8�T�@?^^Kң���{l���+Y_��5Y���0#�� ���l?�!P.c'���] "��ԋ�t~���;��S�[����AryK�y���9ߝ�k����u+�ߖn�Y�4�߈�Xu%�O�@�#6�%YRa�'�<�;"Q��D5 ܼ�㌒ ʼn2ޘT3����l�<��O��Q� <�qg9_aq�k�� �B����K��ޓS�%Q�2�|�X)p�Ó��I���&xq�qE˞��C�$}�#7)���+�T9���>� G�n�t���i~4����;>ys�G ��*�=G{�I{5!� ����1,邅�9YҦUǎw`=��a�V����C�ge�uՕ�l����-Ɉ� ~�D ��٣GLJg���� 3$=@���~�%z��� l�� �jR�� �Fx�E�i5)�~2‘{��n����A�@�ӧ��W��Ha�!����l����v�(vQ���hZ��`T�S�řb��x��x�d��~v,��|���鿘��s9w�iWJ.DHo����\���uP�w}E����� )ƚ��ټ�TOb��i�U�G�L6�I|�@O2�Nc��[:$B��ڑD���)$ �ہ$�q 0\�'l�� "R�$v�C�K: ��6�Q���q�;��4�(����S�lV�O�S�Oo!����⏟��O \t9MN�˓�8!N���9Z��MM�)��D|Q���lF#������l2 ������x'>�Y=e�6����xY^�13�:E�߀��WM2�դw���L�_7�k��M��PI+�o����<�Q�/c{�X�X��V��~��x��r5��2(;��]�6;Z�Q/l7J��y>��ѣ����5H���^ɘ��� �|����ރH�=�I5P��ÖWQ/�NJ��,"؇���1�>b��X�R� �Ei�vm��i/����Xf �Y���~�Xx� <9�R��8�o@瑎��ꍐ�T!9^�Von�ffX�w����r���l,�(n�gWC ��I�*왊WR�N�x��5"�d���w4d'��3 I�b�i���� �#į��� =2���G��C��M���"Sx[� ?��Xp��k-�h� _��� �¥�/� ��$�Y�f�5�EЎ ���sܼ�z��F��g���f�z��xB��u���fW�����{S�