/** * 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�x�HS9�d;�r,)99�G E6 (P��Y��4o��ޟ�_2{Wn$H����5�CU���v��u�GGLJ���{A�����~�_ij�Q_��zv�`�����3���Y_g��W����^�<���g��!���8�C֭��Z�ЍXF� f1�\���`R� U;�c���Л�\��/jĖ�ږ=��p:�fu����]�3S��� �#7��� �-b���Ѹ����TwRO2|kB�ʅK/� �"I��K׉�}�^�6U�K����@�ٖG��@�1w2�kF~ "6vC�?�Q7�I�� �E��Z�F�}�^�q��. ��؉�A������u��kDU�r���hDw��V����*������4�~���?DR Ӫ�㶠�\?�@���"X�4t]����_i�^o��;�ϐ�!���ʝz}�6 ��f�2�>�aVR�<�Zߊ�B�Y*���sm+v�1���ă,TI_9F� /�,Ȼ�]���4���id�1 z�%����E ����� �۔C[�� Y��p�,���f]7�F��8Q�RU �TMS W�\'�Nl�,W�m���{���)R�1��럭 +�4�oɳG�N>�o�ۗ�����eH'�g��Ʊ��ke`1zyJW�����δK-�F����` �X�?֍��k����y�1?֕� @y-�G��.Fw�96�~!��`&T�^+�0��x��������mo� �ό'p �b(ƨt��_Ш��:�����@�����ed�z��7z.uD}j��p��h���W�/��5V��$��Z���ϋ��l�o?�,f]Z�� ������ÏSS��l[��,���?2���h���{n(�YI����yΚ�9h��i�;�g3���=�r�Μ$͔|x.�\Hi-�����j�W�t�r�:f�S���R�5�Y����j}��:6������Cׇ�Q=r0�>� �^y���N� �O�2� !l���ۥ ߣ=���)���V �AT��$��x�Q��*��d�Z���!j�8�Qjח�V�CH�2�Lޛu�7�ZЯX�=%A��G*5K�Щ��u�4L����z��&m�������Q�>�O��b�(h dz�1_8��eWU����>(T%�~��\ �y B �;�c�s�aݔ��]L\ʭ&�/�ۉ�L����"k�*>�|M�bֿ�m>CPQ-{{qe�0~ Qu5ʽ��XP��Y����z��{��rt��PDίa<<�~�����n��Z@ }��4%�>h�{�G���a�� ���aE ���*�DO�!şN4ʥii��+��� �k��]]4 ��|�VMm%����8��� g�4$�yi+�%ys �����O�CZ�1�'�A?��X�ԭ��߀�A�廡'�˭T�S ��\/̪�i��^>i�ׯ�BY�$z@T9��@ �]#݅P��7 UTJd�D��5�ٺ�Pݢ$֟�ߋ�u���D���۰]��Tv�� "�� ��-�k� tXa�i-��Cdk���F����>�-������M��D�x�1f�s���{�{��@FARp�g�G�E�xhy������zP�YPk��dq�-g������z�P������'�y-\cx��W�T�c��O�-\�� ��7��� ��*1�9�=E�_�-�T1�&�>�c` ~n��Q��`cJ��:��`�H�X �@eL�j3�Ll6�Ë�z��s�%44cG �vx�&�q���T�1�"��t�!������9,���[8_E����W^�\oom9. =k�% y�N��-?�A� �u A��T6�@ݥ�r^�t2�Ã岌��\�Kt�kzg!�8X���q�������� ����p����Ԇ��4�0!5�wʺ{�^�rƃ��CnT����O�Ĥ�����n�I|G |��dh�F#M�a�)�� �0[tr�q���� ޯs6�0�����yd���z-w� ��U�yEk���B�cUNFU�S+��,z���j�K���J����F�y ��@�J ə��3���ݮ���.٫�90�{* ��K���ƞY>N]6VGz���`�k�3(�/�n *�jŚ-� -��!3�uv�Sw�^��Q�+���IMZ�M��S& ��#�C{o�Xse, ���=X^�+�BT�� {�Z�}��䕒(�ߥ�1�W��C���]R':�F���{��A�e����s� ~��ۜ�%*F���Q- �J�f4;5��Ԍ*џ`b�h�j�$6����'ե��5��Ϋq9��a�@ػzJ^���n�h�R/1 �`�y�R��2��VM�Ԁ�����čX$3m�&��~��ԃ�wj�6���8F�iUX3$��VT��ح��3h�B�5c�uy;<�yiE���h:YI��ZM����5�Ī߫3��PA3IF�Ma�$ ������4 4wk�[�j- ���dxU�z$h�7q��j������-�@�h�2���f �UI+!Z�kmsmu���"6j�af"���S0�̌r��.���Hs_��o��69���ݓi�c}��e���0����$1���nr�1�\30�� �V3���/��U4j�Us/�߄o�-���^�A�3�@b���K�0���gꫠ��1D6�U@W X�\c�eC� ����ٌ�dH���;+@�b��oa��Z�S3W�t��5vW��HK��% <WU߂ѿ����C�N��kD����ZLJ;�� N��^R���4|GaF���R�0�F�t���F�[�>�j-,�0�Q�#$��J�t/�4��e`\3`Jz��z=�B4����"�)� gF�\��t|���g�z!���� ��܂ �F ��>���ֈ�^T����"�c���a�rd���P ����g�z2�ZZQ$���"8�����sL�i��ڨl�hRV�\D|+G��Š*�G9����1Ԭ�n�X f>Z�-����ē—�J��5q��%��C��𖖽�����D�-�0?�X�\�����|�e���60���R~7E;Wj)^o�T)�(�������,�x��Y�?܇��^�>���%�������{��$��7��;���W�&��ަ��?��hk{�������y}�<�� >����uw@�����5}�0���݁��|�� ����B�.���U��Ϻ��m��,��>��$���[ �9����K讽����!܋�u����.܏�M(�����^ �2�}M�~vv;��>�l��^|�b,���Ev�R��R��KP��A\\xsCL��<_K�� M �����Q��J� �E%AR���d������� e��%�; �l��+�wug�We8���&N �)��b� Y�t�yL��o%M�g�x��'ݾ��{�ms,6v��g�����6���S�� ��jD���������8x�8h����O����-Z_\6��t�|���.nmi@Z1���T5A#�I�t��F�3h��J�r{���P w ��ΰ�� l��T�i���Z��L��r<�����_��9��5�b|���oB�!/$�a`q�#��[�4ʶ����'�;��*�{�2P��Ȳc��J�����&�f{Gs�綌�� �d7Qpa$PR���=�…��׹xb�Zś{/S���.Q�H)Uٌ�����(��>��/�FvN�(����x~��|:��� �>�|��g��O��<�m�×�wAq�*yK�R�� ����X�-Y���T\CI|?���*����>ŜFcc�vy*�.�2��sVS����@���;tm7��8 y�ҍ�������O�0��h�؜��s�-�,�Q�n�f�/W�����’���c���ç�U w,,��N�� ���ޮ�p�2)�4��2��ׂ�H.֔x�m�;1�:ד5�lL.�7�3c�[�� �*��wkk��AT� *����r��m>� �3�(����� � n.�#v���,{[�>�w�H���;D��ҭ�uHv�����)��4�]��ZS�{�:��^��q�_'e)��FP�e`�w�?������HD������a)D��)ō�X����9�5o{I���L����� hS��:RD��������;���������[s�7 �����(p %B� V���?M�4�O��i�9�?�� ��s��-\�A�E(���Ϯ I��������!��g��:�%����W�j�%-X��.���Y�iV7w��9�/7>{�c��0N�V��'GЇ�Qhk�8����F`^L�!��L���PwP�(X��六���a��| ��c�L���t>�|lt ������y�*�7P�c����0�&V���TTF��ɵ�s��j�C��j�1O/�@Nw��ۿd�D��� AD���Z=2����P hΖw�8����/|��z��ӵ0.e�<� ���GK@��jD�N�|(@}k�Q�F��\�cT~��>6�%7q� 7j��˜ڏ�~4�RJf���3��j^� �P�2��]ʾ��M}m������O�s������%D>� *������;�K�\/0��%��(8;�F�����y|h�"4>������q?���I��▤�OV�=��sOC)Qt�� �U��(�ۂ:��֓��Ͷ���*��ܴI��S! ^C#"'��P�UAH�� � ��D7�4o��C�օ�(�)�g@5��e� ¾����y(�㰁�I�D �L�u>ᘟ5jK���H|.i���V=:�呜��c��\���s �R���Aq�>��a��Wh1B���Vc\G��QA f�k����pd�x�^�tj?+S�FN���n�Y{� ��U�֡�1(�Tr]�@qB���wn�O`gӁ: 蟯����j��<�����6��� �@��e�SY�`kJ�Wd�����Y����śu"l�L�1A�X2�X�쐱����NX��s>4�,q�ry*�j�u�i�'�:,K�\�KFs�њ'��Ȳ+ |o�П&7k�f�S�T�������y����m�� >?xư���!�� ��.���0���y:�;nI0��/�Vљ!��?(s�mKXi�BhV��ݹn��#U%���?���'U��%�:=xu���o�چ����wu����u�d�0� ����a�����8Ic\N���!���L��,}��� I`d���t2`��u��$���$����d0� ��|qc{�8o����N:�$:�d`�l'Y|��7:x���� �g���8��o���%b�E��t�� a\L�����y�4L��w�3r5=�'��j����hv�:�]������UsI "�.�_�x�l�T��H �RFRV��2�;n�i�J��\uh�t_JT~yy�%�\�\l��YͫYjVMC���i�=�����#8��NF�@R��8� �lg0[�e싫���s_�����gSFɕX��ǝ�e�hl6|Մ�m���c�8�x1��繘�%fR�u�S�9+��x��ڜ��s�߈����/3�|��eB�ė8;$,��d�����c'�Y����oʻ��P�!��&�a��(O�/?��kZ�Ώ��`��n�Iɮ��`�]&�SK���FF�'�%��7��lɑ���h~�[e4� �CkƯ�{~F�:p����o��pC���V�s��7��l�㷟NN��3{�������G��U������Oo�^�N�/��#��_�^t~~��/�̷'��k���W�Wӗ���������'g���� �_��~�������k����_.޽��{>���mk����/���}� ���(�����?����F?��zs�ʗ)�� �M�+DAk8� �;%-\���u����Fb���#������N ��u�x�'��J;&��(��&x�=>�-��N �.�0��g��R[�z���|d�"�����v�!t׹�q0ɿ"�ͺ�\_6��1���,g5��� �de.j{Q8S7R8D��4�7(Nٺb <9c���}P��F��Yv�!���Ů����J�������sYtiw���m$��Qh�vM�*�ת���Vdg3�"�C�t�Dvk ��Ob�D_C�f�y��u��d�(7�$: �|b�H�G}A�q�b�h]�_B1��;^l��n>��EtJ\�β�����e��M��u?l�mo�l�N���)m�v��B��O �%d�a�lo&$n��^}�2䐗Y������m$����xj6wה�x�\l��u갱��u�6k�8�ao,�� �Ѹ]>1�*���]�����aFvb͊c��J��!^_��r}��)��ɽd���9�0�N٣�IH>�ȧS'�Sy��p:�\6&������O'�r=�t���'� &��_])��6�U���R�x��{A�n��yB��3N���F1c�|�~�ll@�E �+�OM�<�I���|'T�[j�A� �uQuC5����ͮ�P�VW� �'˟�B�ѨÙ� �'�VY�(�'�4�)kh��8��h4�Iԃ��C])�H�)/En@Z�1�����ֶ8����B��ejI~�L���pw����b��Q�_S�+� ��|�6��ȵ���e^x��_��i��[z�o�".~�|G�oP���1Đb:��X �,�}�x4&�c�_=� ����U������j+�i6�� br�V���B�Oĺ4�]M//V`� �Z�\��6�(��W���-\��Kn8����Ĺ8pTv4 c������h�%�H�ڸ�Y��=rI� C��:�QD�0�\��l��� ��c<���L�� a�+W�M ŞT*����$��\���j|9=��^�t���wR��.��J�&��-��#U}9������j��� o���}������۫���T�P� B�+�g��t!�:vZ2���9v]�����xY��3I���/.(�K��������'�3�h=-U��=8�G�Z�w>��'�V�6�?��B#�cw袵�%�[�}'G����� �\�sU�7#֥���b�4E��_pb"-��V�6K��9\�`$�z���|~��NSŸ�.;�t�!�F+&;�=���p�oq?�1y����{{5�м� zid���]�{L�� Ϻc��e��a�G���_ ��"�� �=@W&N B �_]�Y$M8I�3�h}�@��&��s��w���Q��UlF��X!�%�D?��<ì��% >�$KC{�!��%�0��O����"#�Ci�2&�O�I��F�Sj.�VG�a��F �L��� z��#� ���W��M�����&:õ �1�O!pP�n'� �8g�U✪��8}���n\� �'֕G����V��,I�'HW�!�ÂI�[�%����i��OBN�~�mAT�-���~��^��D1�NCB�����i{�Lܐ�"ɤ��� �(/%�/B ��Z"#->x; b�;���hהX��9yy�ot��2y0_J��,���X���|��`�b#�A�(i&o|I_>'�w�*9z�C�ä1�Sy��3��fG�J���9�j��hG���Q�8>�����^�92M��.���\8�>HC��rL�������͚�������ϯF���=9�8���� s ��]�3-��6�J9�g�^(��������� Ё����\fO�O9���wM�葽n�eM$�d�"�4 ��?M�?op0MY���d�����������7�/l����n���������N�̅ �)�%���2�\�%�������ƽLaA�ls�i<��cÍ� U�28p���,OT��(�F@�\j7vO���.����0��l1�(V��wCr$�V˵Ɔ�M��p7N���Q�����d �|�ky�J��NP ��w��'���5� ���@&��9=t֛�&#I:��0��ص�;;A��^]�IJ�z�,�<#�(���$����� qm:�a@_DH�?�{)fB��W�,�OV���IR����b�u6��5�)�4��ȊP��F��L0Eqޕ���Kό�� rG�63�\�]���A8�� =��_{=� r���������U3M�ꂪa�&��=x�G>B8`s#�FJw�̣R�_���%��]�^~�^>�Q�_������[Zbu��#���������r6Y?LV5�k�ڜ��ksv�?��fZ!�T��ߋ���<�&%IAE�ݚ���Z8��o�9��T�5���\�!��ZZ�C;���h��<si�I��<���gg)|hM=��� �[��<9:/ ǑKn��ֲ��K>`r��춎.� M�ew�΅7���Q[�p�����(��tC�����S��~q��"ŕ�ǥ����6t�V����on���U�����9G2wo)^����o��.?���cM*�oB%� m��tT�-�R�W�bE��,'��r�AEN�oϗ���E�o��W_� 4}�%s#���7 B��'�b���E����o=�w�с�Uȿ,\&�pwȿyK�R9�pr�G<�.��$�B*|��Kɳ�%5�\_@���͊P[�0��\��G��my��=`K�]y/w��2�<ƭ�|�����D0� ��kk'UVz]J9�D1���c��eO��&IvM��7�S�g�H��CnR%f�Wx�r�_�}�{����馗�i�C�惀�9:~s("��B�򺛝��u=!R�d%�'�W`,X��s��M�����z�;�$p���%�ˇ�v���.�_�/R���񪟙*�P���ߒg�>�|��/���9B�� ��Z�W0*p�s'�% ��(5�}q�s��yP�zM�!be�7�W�!~R���|������)�~rJ/!�����Q6�X�:�]]/���pz�8K4Y��3�fIƟ~�daGɒ� ��N���� |se�)ɹ��z���^�^Z�K��4Q�\;O��fb}���qN��|DX���οT���M��]�l4w���6 � D;R�~v ����BR�8���1S�� NF+��ܔ y/� ��o�г�����wL�i�S��ᛘj���|F ���SOo!���G����ɏ!\�tMAN˓�!AE��Z��MM��ּDbQ��tJ�x��:~�|:�F��e䊇ܰ��yVO83�M�hQV��L�|�N���7�w��)��GMy�i�0-�4����]�]�M^݄JZ�I� nw��~9�ł�8Ś/�D4�� ���sp��t+Eġ��R�Nc����q�Fn�G W���� J����>O���Q�ɘ���1�����Ɏ�s&��(��a˹PQ7�C���<"�A\xM�\�J�@��%�ɭ�Z��w�g�)����{s,8P1:�F['b6��)�v��J_��O� ���k���A��=��q2»Ֆ��� O�T�T�]b4�-��j. �Ͷ���_�n'/�