/** * 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���_��g��L�3��=��y����\��B�!�iѠ��]jzc'�� ���*��cz����b�^L�����E������*�iMi#�����t}�V���9�� �� � Fg46�55È�C���ғH#���J���0�� 9�.;�mz�XTa/2q<'v�|d�.�M�� ����������ܳ�+��4w�H_&�f4�58`��N��8�I����Kř���>���k�����2=���!r�R�ԜǾD�O2�)��'ɘV'� � 5�xqJt,���iZpI�6����a�Rw�c{22��5��U��h�c�N|�8V�0+)�.T�g�T"�U*6��u,3v|�F�w�3�P%C����D3 �rv@��К�������%/)���-h � �`���͠��M9�D����[ ���`��mh��HQ��1"�g���U)�ez��MN���Ϙ^ƍ�湙z�Ʒ�٣��'�ȷ�� dz� ��"�3��sLc�0�Ȑ\K#3���+ ��z����c�5��#�pH?6X� ��jj�c�k\v�� I��(��^�����AA� ���� �}�z* �%p`7�X�r�~D�x�;����%0 T������Î�U ��fT���L�������H�P�����Z}4�{Zq͑����_�d����F��qx����u4�?��(�T��<��`P��9�u��t��h\���F4��q쇠6<�� |͗:>z�F�'�����7�k��nnR�A h kT�@��=��&k2��؋�{���wwuH����Z �Z}� �\��n�ah^ը:��N�wsԪ �u9�����x����nH�y�X�`W��^A}�k�I��a�!�tS�}T��G- ~[�n���=�sϴ�[������R����B ����*N��ANR��N���>�*�F"�~#0�Y���Z�F%p�t�x��<�G���7?�B�W�?2�c��ӧu�zA{��J��ў��c��z�Pk����� �� ^�����-Y���0D�?�� �dؒ|}m�=��/C���ݫ�#��.�Ú�"�sPtZ�}��$�*�CC��i�i@$��D7i��/ d͵�����~�5S��$��)�|�8�]U}7V���BUP"x�G����&P�>�:� �J��B�D�ܚ�n�"߹s_Ir4��[�,����G�k���)���ۋK��K(���)�~�bA�j���s����CԤã7<~ 1=� ���ދ�j���kY��� Ӕ���C���J=�$���9��>�[����@C�7��h�KS���W��<�A|��Z=M4 ��|�VOm%����Q�M�1��ъ�RC�:}���S�%�������C[�g�?�߀�A�5黱�Ǭ˭տ� �C����<#��O�g��j`�P*I�U�$kЂ�k�a���`�F@��Z�,��._�8l-��[Ab�Y�=���͸Lü [5oHE�"�����݂��AǵH���<[���+4 �5����Z�t�C �rmP�ݰ2���By�7�G`�h�U%��[�1�/���ߣ2 ��;@o|5|��[����L�K������f�HE3�j����Z�(�k��$,���?�ͫ����ó�>��;<} n�B<�N����Pu� �W��l��]^2�c�M>}��������6�����;ı�;�<��)��}�1��E��~��V��i�W��p@� �Sc�W���Z��~�a�+���M�I�^�9��2��b�ĠR�V��J��t��1#\�g��j�s�ܱ���_yl� j�j8w�ןG�X�7�(�%���m�-�w�������l%�n h���s6�˺�U߯#��PA+IF[-n�$ ����/M��ܽU}�&����M�U��u@�N�{爀�F˩�ߜ_�B D��N;3 Hk��_���%M�kۨ=���!bS�u#��G�����r�D[�m����-z�7`t[�vF�g0�d�9�X�pY�[&u�!ԃ�(ZM]3���F��MVٺq������*2h���[��u�����K�5~f�B ф�p)���� m[ �Ȧ� �2k `Q`ZuB��0Am�B:[�d �� ���+�ۘ��W@t�P�U ]i��� ���U�S��pE�L��P �:�?�ypM&�j�k1)mS�$8��~���ҭe��od���.� �j�J�X\i&8���^�S�" }+�A�*����bJCZS��� �R�.��_O���#U0�б�0#߾"%,��(�vo���K� ��e#d��� �)  �=�;$����ׯ���"�c���a�rd���P ���̋��d䵴�HNm�EpvU���V��U��Q�Ѥ�:5#>r���s3�-���G9�Y]�Xf6Z������ē�W�J��5q����C���V������D���Pi���Tl��7�\.��"�q�f�Z��hK�����FHy� ��͗'��f��܇����>Dn�����/���=�}����< ᵽѽh��Gݿ*7�\�6�M���E[��ݟ�m���� 乗�yw@�����5|�������>�T����Op}vZw�]w���|�]Mm#_ugQ��Qw&��7ݲ`��ie�0�XAw�ňu�b �^,�C`���lu�~ nBim_�_|xH�*�W���k�����W��UK��ce� �%N<%'@��>�(����� f7�%���Ë��|֬��jX�:S\XҺ�6�`�������nNnť�X�Y*?v;�)(%���ĶT�tg�S��O�aܱ��E���/W�1�#Xp��#?3c5]�\b8�B\vwB:}���@#���i7�<�e��*h�Ї�8���x*��`�8i�b�[���أ������l���W4Ra��Z~چ�|6)�����rc*�lMi�K��|> P�9\�='D��eR� ��"����c�L�_i�`���ؘπ ���%�d:U�a(����*-�qY�/ �*�]&��Ȣ+�=�j�?MnπX�S�T�������k����m�� ^ c�:H���d�Zx�?olU˾�L�@�b�-�tF���*:3�V�U��,+ � U��}w�z�HQ�����ߏG��IQ�r�G�N�_/�g���[�����ei��8N"�O���&���4D���h� �t^y��J���� �r�U��/�T�L��g��y�� ����zl�8o�����Mu1kD�d= [e �����~�G��~���/�`7eR�k�&�a �$�Rrxv�������n�mx6�H��iT�;��@#���yŮ���z&�2r�Ư�g�g�pS=��� ����o�����~:>����+[��gw�=?<��_5��_������ao|q~����燑���E��W����x{��^ۧ?�����l�;����<=�������M`����SWs~�N&m�]�o�r���o����o��/���r<��y�����/������~�ѱϿ�0���ի7çl)�����d�B$��C����P�¹]����̽��3�7̅y'0��@O�v_t �o�sg�"?17W�1�OD�XT4����)mi,tZw1��I�?Sȕ��i <���m���S.�_ͩ�]�R��,���7�s}�“�h�:� �m$�J�R̯�+"�=�?��E���H�k�T\ķ���0F���5�+_�"�[��� )�� ?��N��NbmA߳�xc,'Ǣ���:����K��gW�r�m�?�� ƍdOp4�!�g�!���%#P��c�֩�փ�[D����-+k z ��XF����Y�ö�Ά��:O�ҦkW� �����ZBvV��fB�V�)��֗�w,CX�uk[H�F"~�΀�V����G���`��Z����C@�Y��� k�`ဗX/\h������T��-�3tՃ����q�5+��9+)?��x}q���ۧ�J�{�P�%�0�2٥�IH6�ȦS'�y)�|�:є�'��46�9��F��$�J�r`H��Jq|t����<����9��f���4���Ō3xk|�l�CE���M��h�Ԭ@�m����m2�� C q+ZW�:'�60Z��h��yF��}mF���p�+P㋏yz��5��BW0o4�a$�x ��!Uq����$6-�kAUeY[Z1y6X@�m��*�$�ll$���z�W3li�55�)1�o��c��ɔB�5#���|~�aٞ�IX�gr������ZgSo�ۮA^������mE���G��)�)|g�����ID��W!<;{��:J��O�܈�j��}�h��=��<ǒ�T������f�u�~���^��4L^����c���$����t�efO�]���UL�)M�mvƦֳ������w�?3�X��Teu���1H 5J2gh�b���K #>�}w�A�DZf3m۸P�,�ǃ��/������q�Eq�d�H��� �h�Jt1ϥ�E�%�����VZ2'���VCH5tUo��ch2_ط0�R3P��uy��:= ����3ߞ����j� '���l���;��y�O�m�����^��<�,bk���3+��d�[����ٞƆ��=\Sa��9P�<-�\W�+��84�=X�MN=vP�N3 �b�C�b�"6'�,�N~��9p9�O�1����轒&��X��=�)`7 u೼��z���}�x�I�{����_�M_�Q1W)��};W؝������q��FDh��֘6��1ل���d" ����;Xy<,D�@�~Am<���M���-gj �u������&�0� K����bD� j�2&#J�$0T+��ƚ�[\���"���3q<����8�mL_ �����m7�?A�((m�3\@�.C �#Q�p;V��`�--�T-� ��廀�}C��`�?3/]�M��P��f *�r6����$1PD� ��T��mS������D&fHE�D� fbw���.�xY-��'5c�|( ,Ю)1)��e �������|! {䲰�[�IR`��Z����G3 �� �DA3yc��s2����w8?HC#��K����$�������pG����=?W��]��� �&hhos%N��S�8%�q��,���G ӦT�)��iw�������:���oiN����2������;�v�X����}������ɳip�$�浰e]ǽBAg��3=S�~�]�@���.��'_=��3�U��W?�5�!��W}����<���I2��䓌�:@�gƞw��dIX� ����&�o�� 2p� ����&����d�J,G���"�φ�3�}aQ��(u̱l�� K<7�Ү%6�9���w+�=(9�U���ل��)Լ�.��M��pZ�D�0L����⇰;-������ ��W~��N_�N������ד�_�������C��?>q����`�|=���������ͮ�����y�?��Ͻ�&������Ѿv8��?׺����ޟ�_�_~�L&�aj�̂p�� ������qlZS�AB���2������=.�e�F߅=�ړ]�l_fۀ{��o�� �qK��;��M\8�K/�wwq�a[�F�����@O_ ,K.65p��!� �et>�3���<>146_���g% ,�|�p�� !���H � ��'�� A��O���M�O6���$¦�zV�&d�6������V)�o��/b�{��i��C��t�� {��<�;Z��(�0hqǭȨ�t ���So��[0�pe@�zGiv ��k�Dq���\�oޕ_X# M��3~a��k������ ��h��ۇNd��7����=C�wI�l�3A>�ݑd�y Q6[����ygt9·>)S.�����`a >m��U�G�E�-|���ّ��V�J�`J!Cvtc�a&��3��p r�9��=��/SXŭ��g��A�p78)]� ��׊5m�j�cE�p������n$�7�H¤�fh�QR��l3u�X-p �H��![-���6�k�-P8mW!�{�G]6 �_#Ȓu��-�� *��_8:@M�|�]Ҟx����&Z��K���Yo2C��D�b;c�t�����:|&Q(�-����t�@��RN[ Fs0ĵ蔅C�!1~���τ�y�ײp +X������2���m��މ���Ma9�EV��r��kf�)�C��U)=32�[\ȝ�`��ryw����f�/!�����n�y������0]���TM��L�_���#�#>67m�r�M����o�&/C0� ?��ʗa����%�0{����DKK�Q]�xl}�?!�JFz�([�`���tvJ����}�ʹF�� R���}y�\�������Ӊ�u[8����9f7���5���\�1�R� -����G�h��<ci��o�<���gg)|`�#z����G�r��xܴ, ÑK��)K2 09Uev����Բ�> Zg��� �%/C��hk�Ӌ�>ݐ��Ma��p�ӛA�L�����k�I�k�o��ld[&��J#������?�/���� ���? ��B\F��6��_��׺�l��qS��ި;ꏤv�A�}S���bߓ/�X��<.�7p��rl[Ƹ�kT�����[�ҬL���(�#Aj�5T<p�I�M<�m������bpd�$�.� �_ '�������x���LV��c�B��T+/�`?�yoR�T��L/�h�� �;p���|p\���xM/I���4�?[ҥ���Ŋ��YN�_�AE��(W��^�®4 ����Eq:?�~��p�,�-C��p/�|��� G�n�t���i~�����9��ϵD/����3��e3�G$Y��8�ƨ֑�,��OF8�co۝A% tP;���i)��VR~�ie?�8|�H;f� ��(���4�ZW0*�)��L1Ќb�:tr�d�����1-�f���鿘��]:w�k_J.tH���B�\ᅻ��uP�a~I����D���k&�g�� � �M���`�dPY�;��l�Z#���!"U֎$ꝝCr}f;Ѐ$7!��� pAD|�~2�9.@��K: ��6�!K�A��S�{��q�Ow��1 b6� �G�)����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}�ٱХ&H�Ғ|m��� ����Xf �Y���a�Xx$� <9�R��:��A瑎������T!9^��onffX�w�K��J���l,�(��g�` ��I�*�Y��­�����kP)�7��h�N�Ag@�0�ƳR�5� �'�_%��zdۀ�'XGj�o0>�L�m+G�$ b�����F�E��LD�xO.m~^p}&�2�7ۯA,�vi������o\�7�7܂�V4C�{Do ����[��mE��?�N�ő�