/** * 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�� ����������ܳ�+��4�(���Ќֳ��� ��G;)՝�y�83sB�r5p�pBw��V���>D�W ���ؗ��I&<��$����6�F/A��� ؀45M .��f�Z2��B�wl/BF�4��;��v�1`�ԉ�O��'��bf%%Ӆ��̘J$� @�f��eƎ�5�(��r�B�d(���h�]���tZS�44�����%������!�����_�)��(��z���Y,��: �� " Q"FD� 4�� *ŵL��@<�ϡ��q� ��˸��<7So���<{���p�d����}�x���]t�v�i &�kidF�4t��`�c�c#R/T?�|l�F}���+����UMm~lt�ˮ�!�0�����Kt>�>(Ȱ��!<�UO���N�+�_�ڏ��r�6����A�� �p�ߟ�p�Q��!��� ������R�)��8�Q���s�B+�9�W�>7C�ˑLw�tb�h�:�X^<������рʱ3�'s j� ��������k��݈F�9��Ԧ�������O�Go���_��z��bM���MJ>� d�����V\�dM�w�{Qy����� �{�Z�\��r��S��Mc? ͫU'��)�n��Z��.���=x�O�CqS� i<=��ખ�+��~-2�p8 ?ğnꙂ牂� ��X�4v͉4��qn������c��?� M��w���i)بV���>xTDk���sS*gq$9��ӧ�ʜ������o���=��v�V�wK��R�9�R����^H�����]V�I�:�Ij#��I�?�GRE�Hd�o=��qR��(¡N��z�GC������_h���G�{l�}�4��B/h�U �=���x ^�R�j �b���Q!� �b�V��%Ku��h�|A� [��/������eH���{5x���eX3U�{J�N �?�dS�ph(u4�4 ��������&m�������Q��?�Oøf�4�2=Ř��������jZCP� J�H�r���Sǵ�a�T��]�Ϝ�[�!� ^�;�c�k#I��x���U|�=U��hx��|<�2�"9{{qi� ~ Qu2e�OP,��QM�~qr�v�{��tx��Gï!��A?��{QV 7�y- ����a��utȼ~�#�Z�g�$=�2g\���gp��0�hH�� sij����*��g9��:Z��i�f����ꩭ�Ss�S�!ʹ�1fACB���" Z�Wj(�@��_?} ���1�Yb�sh��L�R�G�P4h�&}7Vc��u���w$|(��Q]��`� ��I��;^ ,�B%I��ʑd Z�|�< B�l��UQ�����k� ���y+H�?k��cC����i��a�� ���A��[��\"��s9���g��z�F����>�}Z(/����M��D�x�1f�%���{�{��@FARp药��tx ���tݑi}ɷ�<�v���,��bF[��?�Y+�z�Q������'�y5\cx���Tc��O�-\��‰7�����j5>�mߚ���K�"u��ɧO{X� ��~\����є�x�8�pǟ� �5�����2fT��(�o63ÊG���J60h��n��6�Hͨ���)�7`Es��s #�k9�%,{��[8�E��5`���8���ڲ�(pͫ�H�#g�lz�.��Ц���s1�R��&��2[�m��J9,X�ʘ����D#��u�AQ1�|�u&�h�"4�I����*���b�Qȸ�N�vV(q����uF�^mn�X�����,pȘ�3nb�kF8�ōv Yc0�����q�{gg��k�w�p�x<�f�WDj�hv��.7!%4mg ��\��ki�Ql w6q��ʂ:�jj��&���NX��6��4mCL>m���Ѧ���k����~����ɜ U���#��E�k�x�~|�(���X[Q�(�>Vad%�cn����*����V�������h�d ���@r�-����;��J�>H��wJ`L� TTˀ<��O5�uez8w��2 �k=6G��UfP�_L�T�Պ5[ �.U0f���l�[ w�;�R�+���A Z �Ρ���H+�&��N�X�2&��X�-/��t!*� �wG�5j��T�W���Re#�=j�ck�<���7�:���< \��:-�8Ag=�n�R�93LK��fۦ9���ZG�[]�0��^'�L������!�U'��=�/%]�pF;����k�a`����&ZO֛ڭ�+L9Xb^��`� �-k�0�-�H܈N2�k���H =ZWnu��m�1�L�¼B��N`E%͞,��l����d�߾����.Ҽ0Ù��Y8��$�m�V|��tY7���ub�5�*h%i�h��ͣ��aa�^��i@�Փ����Z����ɰ�2�H��qo���h95����[(� ��igFi�6���vB���cm��ї5Dlʺnd"������Q�ak��4�Eo��n����� � =G�.�wkä.�#�z�E��k���5��*[7n5��c{<�_EC�� ���^R{i��� Y�!�.����bK��tV]&`-c, L �N~4&��VHg�@� ��]�}E~��� �@�� � M��[����u*@X�(� ��T���@�0��D�S�r-&�mJ�'wٯ�VQ���4� ��rU٥�a\�Vi�+��<����r X��/�`�0H^���\LiHk��q]S�إ������x� f:vf��W���:����M9)!b�߻l��@�;�`A;��B!�Gp�ķ2����u:�^�y�8��2LX�,9�A8�yQ�����Vɩ��ή* ?��jZ�j�7*�#��U�f�G.<�#brn��壜z~��(5k�+���Ak�c�8�AҚxR� \iԸ&��Wuh��ʲ������H��U�#�5���-��Ƙ�ŖYD6.��,�BK��m��R�<�)/R��������,�x��Y�?܇��^�>���%�������{��$��7��;���W�&��ަ��?��hk{�������y}�<�� >����uw@�����5}�0���݁��|�� ����B�.���U��Ϻ��m��,��>��$���[ �9����+讽��V�!܋�u����.܏�M(�����^�*�}M�~vv;��>�j��^|Tb��ʋ �"��n)�d���%�V� ..<��!�e~��%܋L���Fq��^t��*h%���� ���� ����l H��zC�l��y�*��u�; d�*�]��e������E�ʼ0�xC9���s?f[IS��l�m�I������6��f4u,ߋ�+,�s�m`���'�A8�>��ؿ�3ǽ�6c�Is��iO����=}�5{�wضh~q�X�cO�˸m��֖j�Gl��֖�$hx@8Kb�y�lwG��n%\n/P5@Jᮢqg�ww[x�TlZl�//Rp�K�)r����-l�=h�����|e�E� IU�8���@ì�BeGӪ ��ߝ'���;(�^ dZ�sN ��zIM�I���9�s[F�p�A�K\ TT� c����a�\,1]�b�}7S!��Q�(U����L���oL똽�H��ӉO��;��!��tty5�����"|=ͽx�O�QMh{.��@�s��U�[:���A��.Vh[Th�?�Pyۏ(�����,=�O1���X�]� �����È9�i|K^\ ���;�_��'��‰����]��G%cߚ�Ubs���솷d��~x���Ϛտ\ �[�`� KZ�����ZB��FQM�q�‚�j���p���N]ƽˤ*S�ԫ�_ �#�XS⥶���Xj�'k�lL�.�7c3c�[�� �*2�wkk��/���o���2��m>�Р3�(�[��u�@7��;��y�-^���f��sv��d ҭ� H������9��T�]���jK�?�P6�s7���8鯓���_#��D`�w�?��,L�\�LA�[�� ���C��������D""��� K!�k�H)n|�bխϙ�ycK��D�O@&0�K�#�g*x���9��r��|��_��qyk�x@{��R�P"�nbU�{�O���(���o`���ml��&�/B Pb?�($�Ft�z��7���#�cׁ,�k�_���T�.^��w�w4΍N#D����述������7�؅�^�n@J�����{@����1Q��P��2���)B�A �`̷������q��%�[�2�*��u�W~�r� @�/��߼NEf ���JT>�332�)���f���N�N����̑Km��ۙ�(���=Pƙl��S�u�I������G���?_og�}M<���2�����6��I�@��e�SQ�`kJ�W]�����)X�*����9! V.�bL>�����dj$�JS� �t��|T �%X,A%ө�C15�$W�Ui��˚|Y�T�2�5E]��W �ir{�f4�?LEO�ޮ�iOؽ[���V���2�����Nf��wa���V����$t!v܂`Lgd�;���3ClEP�,��€��Q%{�w纡g��<~L����q� �e/�x��d���bz��ͳj�rv������{J�ƓyJ�A���0&�˱�&�|��K�y�d��)���oS�^!���m+��F�2ul�*�*j*ɭj�4L�Bd)_�X1 ����;Ǟx�� l" �I&������A("�=���DU?��n�!�%b�y��t��� a\L����,�m@0b�Hs����w�%��&D~A��My(���4c"��g�ym�;�"r 5=�'a�d��w�����n��EUd~�p�*�$B�/a�v8�I*�!%NL�Æ�.�]-@�2����\]��/�sr���yD�%_�����UKe��l䳕�o�}\����$��d���`���IC�=N��@L���J�T�gؿa ")_e�"JE˄\�/qvH�'I����Ƕ��V��]?�Tw���A�M�ðP��_�}��LMc�~���/�`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+ZG��'�1hj���h���<#��>�6�{dtE������<�|�Z}�+�7�0 <��ߐ�8RpBK�x̵����--��<,�ж�c�Z��q66n�Of=������甘ɷ� ܱI�dJ!ך ��yqq� �̇�l�ۤ ,�39��C��{�����m� /w�ii�Ƕ"f���#l�������w�$"������=^�o� �y�;�T���-5��U��X2�����,����o�� ߚ揉����\z�u�� ���4�����㾭hݎ���Q[鍨���V���վ�N����gfX�ʬ�91C�b�FI� m��Cl\�|5a�'��2�9�l�m�ʞ��x���%���^4�7.��$.����~�� �PB�� �T�豄?xQ�JK�GX9�j领��x �� �FRj ��.WX�g�:�d`c��s�6�R ��q���|g3>��m?�5�.ދ���ǟEB��fR� p��C3�S8������˪"r� �W� �sE����F0��ɩ��*�i2�bjL|�Q�X��$���O���.vk 1ˆ-q��&Z@8#&��_�s�H�X�m�ob�!��!���D�?7]����% �]� W��$��;$,w�����ʘ�( ��P��g�3k�rW�ڊ��N��t��#p�w2}�����޷i�$������p ;Yt )F���dXa����S�$�,������ � x���̼t�7��C��n�%���*9D�Y#I{ ����y��O�Y�~�m]����P w��ߦV��@qO4p@S�"�Me�s ����!EI/���A$^^H$^�@�e�D�I1D� �hה�r����U�`���=rY��-u�$)��J-����棙���S�E�������9��W��;�$�����O���|G|[h�MQ�x�#p����[��.u �lu �H44����� '‡�)I�W�8�|����iS�������i�ZRK��w5��NNTs_��`�GH�o��K;K,m������|W���48Ko�Z�2����^����љ��� ��.T`h- D�“��'�B���ɐ��þ�q MrS�a�$��H�U�Z�É3cϻ遲$, g����my�7��8�q�He�Y|�Y2K%V�I~S��j��򾰮�N�:�X6��%��ai�Ü�o�����6�̪�J�lB��j^C��G�PC=�Yf'Ѯ S#�&��-�NKv~}~��B����߇��ǧ������-|��d���������=y�O�7��?�'_Op��ǧ����g�k��d�o~��O��s������o�s���&�ϵ��8d�������ᗟ&��p��'� �s�5z�.!f�֔w�n���?%�>�)�`�K7��wa[��d�$;���6����l�g�`���gas���� ��]�l�V����`"�S�W�B˒�M �avNf�f�O�ب��y�O �����Y  4� �+{�_BG/�?��?Hc�I�`CPx��uuw���*j(��)��� ٞ��}��݁���UJ��/���޺�v��G�*����޻#5O��{6 1 Z�t+2*��B����E�n�L!\���Q�]C��Z-Q��ǃ�7���ۅw����BS�����%�"(����]�,1ڷq���Ys��g��q���]�4��L�O6x$��n�B���{��)��'�(��r�o}R�\"����?��2|�pk�b��4J�����S �-��N”B�����LVg.����s~�{~�_���[����vC���pR�"��%����&����P+�����K�o���I5����Ӥ65�~�*�Z�p���C�Z�56Bm"׆��pڮB�����l��F�%K�ջf�T���pz�������=��U��M&�82>?��顳�d�0��9�>vƎ��[�ɋu��2L�P2�[dYa�D� /&���0��`�k�) �'Bb�t�� ���of�V�P=Y!���Ie�� ��� ���Š&^?�������8�S��d�Y�Rzfd,��,�;2�������"�;��+f��#^B������ �j���ť\a�R��/��(ٜ����GG|ln�H�.�2*i���M^�`.~���/3�����K�k`����1����X������,��kB����XQ���^�W�씮����� �i�$S�ο%���<�&?IAI�ݨ��pփݤs�.ɩ�k U��c�rZ�A;� �h=y���3ߦy�vY��R���G���� n�����iY�#������d@>`r��얏�%M�e~�΄7���K^�����§�}�!�ݛ��S�:&>�7��,�g){��"?����R����vM8�4F���q���߉����ǯ��)|���_mz�����u����5��Qw�I7���+�8�;_��>)_��y\�o�6��ض�q��2����q���ĽY�"��Q>G�Ԓ��x&����x��D+hM��*�ȄI�]v�N�dz��Ǖg"�v�L����g�n�שV��~��ޤt�.^��� �d?�v�,A�� P�; �^��.��7h���KY_��Y���0#>4 ���l?�!P�b'�G��j"��Ջ�t~���;��Y�[����^r�L�y���9��;��p�uk��.�Y���߈�Ev)�O�@�#6�%Y5Rc�<�<�["Q��D5 �Uj�'�e� �g@[.�b��%y8���;�Zx��b����xM'r��䵵�*+��K�u����V�2�'As�$A7zM��7▙C�>I��CnRf�Wx�r�_�}�{�����f7g��t ���sx�怏^sU���v�� �� +@>q�c���Yx��%m Pu� �#�&��ʶ��/�>+k���d ��2JA��_�1 i|K�=�pp���o�>7C�g}/��k�^Bgc{g���f�H�}q�3�Q#<�# 4Y����p��� �;��J�v����R�+.��0���~q6����v�(vQ���iZ��`T�S�řb��x{��*��ӯ8-�cZr�fq��1�|�t�"׾���^�ѝ��� �C�x��������bgI1�L�����K $��6�����(�����w $���FZ��C"D��I�;;=����v�InB �)*���4� �dzs\����t��7l�C����q�;��H���7>� �4�٬&<A�̟�B�#��?A��B� �r��'�'�)qB� ��qs�ҧY�)��D|Q���dN#������d:������x�>�Y=f�6����xY^�13�:C��߀��,����d���ô����_���z���&T� ��� �fR�����\,�S��bKD @?���<�3p�t;OȠ����n���i�V���(���y�F�>����Y5 uY$c 2Gl�w4�Nv��E"H H�AQ.[θ��K��,2����4�*z���脯�Dd�7u���`�g�,�|���"hF��8��