/** * 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�Le˒�\l˱�dg�h��A@Q���:�0O�v�b����/���ƕ EJJΜY�8�]]������٣㓣��߽ �h��>�?�1��@��|~*a5,r�,�=��c�1�.���+O�=�D}Ϳ�yV�����B& �I�a�^�j�#;#?��p��6\�����/��Q7���ll�a}ސ#/2�4� ���a�sXG��gX �U>�1���G��F1'F�h ��������1��Ҧs� "��in[�d`�Kۤ2{�۵#ȇ��Ё��Dv�=�9�l�������\Z��Y�Cd ��Ћ½���Ը���1�2(��;F0�{Hb'Up�+B�+�Y�I��T#<���U�5�m@U�n��lSF�>i���_���$�dX��Yn���hdN�x����#�*c�C��v���8LKJ�u��H��A���;�iD��փ0��j�@�d �`���X��]���d��40��y��%������.��y�)�_�-��(����B�,���z]m�U�>�e�.�D����E4 �sA$���qJ�� �E�*�6.��+Կ%�}8:><;�@����m�����ܧS�}J#@>ɀ\KC#��#����2W�`����l�*4���Ǻ�RT���ѯ:�ǺT��(���^�����AA� ���� �=�i*��%h�`&�X�j�~DGk��3����%0 2��c������Qt��fT���M쐌l����GS����Z}4��&mŮ���K# ^-���8��Z���ˋ���G?|F�(��ZdO�ɘ���K��W�KÙѓQ�z��04������?�������[%D�7�G�JT�ހ^� ���I�����Q�Q��Ԍ*jM���Ⴝ(��'��[�BH�A�V"W��\��nC? cQ��x�:ލMP+Vk��r�\�S�����4�.� F��$� �^�L: �ѧ�j��Y��pn�����F�1��� ��>άnÄߣQ��lD��Ǚ���n�"�����?����h���ynH�,�$P}��Q��&�6U�m�;�g=���<�r�NA�fB>\HїRZK)�v<@��Ϫ@8 ^I-�ۉ���P*��������>�kE0�f�EG� }ˣzdoD~�/4x�xC�95=�>}Rg!�w�,���d4/N�{� ��L B�j�V � �bgV��%K՚1���0ւ�!�T��C[y��ˀ�1xg���Tkޠb(���v�/� ����VU��!p:����u@��f�G���@? ��Q��$��)�|�8��]Uu?R���BP"x�Gj�V0�V *��u4� �M�����A�BZ�E�s;�6�j��o�5a�j�"\q8�fm>�@PQ-}{qeR?z Qu5ʼ���S������zm������~_C�<�~�����n��ZBq}��$%�>�y}#�J�g�=�2{T���gp�� �hHrg�! 2iJ����J��g���j����f ���Ԫ��dS3�S�!���0fACB�W�" Z�Wh(�@��_?} ����0�Yb�sh��Tݒ��P4h�"}7R"�u���w$|(��a�6������'�g��@( �$A�*G�hA�k䡿��`�F@��J�,��Z��aWZ��������{��4~ϝr�Y6+�DAP1��{�T!��*amV�!���J4�n�Q�����>��j�� P��i�J����O����xs~F��[V"m���������=�@ � )��Ƌ�# �|<2gh�_�m= ��,�5�EJ��і3��V D�^+%a��?� n^���G����>U����Sp s�XA8񆖒@U�2�_��G5�3g����C�*F��ӧ �a���?;��c��pBi�Glk���"ɜ�@ޓAS*�a�淛�a��z%�6P%4m���Xe��Բ���O�"��d�������������[�"����WV�\���Xv�;ƢO8�Ȟbn��C/�h�'0�\κ�É�.�sXD��B ��2�F0��>Q�����lPT��^�p�1�ɪ���ox�K��/Ůh�2nv���5FJ:��Ev�a`��M"+b��A�Q=�P�c�`c�m��t�竸�nb! F�D��,�<���tmz���F��T�Hm�N���&$�e��~~�����`-�#7�Ea���ixb\YP�fEi��$�#>V KҔF����c��g�4E�[tz�r��]\pޯ363�����y����z#�ϋ�e©Ak˲���ʌ�,�̌�B��_Ք}Ҭ7�5�f�4��[�t���HN���֖{�w��[ ��>�յv��^���j��*�)�1� �3;�����cc8�E�|bG�R�V��R�p��1#\�k�r�K�Ҷ䀂_yl�t��r8g�כ��X�;�<�{��*�10��"�pu���Q�V�3��ak�9p��ݢ�d�+��RK��pg��v�AW� ��g�� ho��hQ�1: �9�p������AR��5Zׂ�Ш�kZ�S��NM�� &V�V��� �Y%��>��$]�pJ;����+��`wՄ�Z��nMk��R/1 �`�y�S��ҁ�VMMՀ�����ĭX�$Sm�&��~��Ѓ�vj�6���8F�IU $���T������� �{��fM�n#oz��4�F0��; fӵ;M��Ċ�؜V�t��^��Y `ŀ �q0�lr�h�iX����Ihvk�[�j-q���dXU�j$hg��q��j�������-�@Kk�R���f �UI+&ZRkm}c�f� Dl�4MOE���)h==��?���zi�+=��� �&������=�Z�0�w\V�ֆI�G� ) �SWuf1��iZ�U���jFS�ry8��F ����Mh��RkE�%�?Sd!�h@h�C^l|�����Bd�^t�5�%��7L�:!�Qa��4���i0�vg H@�5�-�WZk ��+�:��4�Fw H@Z��.aq�,��� �P�u�<�Z#⟢k1.mQ�$8��~�Ԓ��U��o৔�ʮ� �j�J+_\n�8����V�%�y�* f��u�Aɛ�|BZQ��kL�#�^U�dž�F�2�q`[y��g-H�u2JǷ��b6���b���l�,C�;�`B;��R!r@pCķ5bٗ��d���r�o9d��Y,r2�8p6u�r=�Y-�)�Q[y�]�A~�9��4EomU6C4.�L���\x|+F���*�G9����Q j6DW,V�� �6D�`Kp$�� �$�%���qC\ | ���t3��eo��#�;�`E�(Gb/[��1����t\��Y$�V�-�B��xy�R^�#o��I��Y���!����۽�}�o�K�Ca{sj��;Hxcot/�w�Q���m<׽Msv�6�r�'u�����y��A|��o���|w���;`��O�������܇݅�]|ם�j+�uWS��W�Y��}ԝI��M�,�sZ�;̮���x1b;,YC�K�ش=�Z]���P��We���e6v������v�e}h�RŽ�(�X�Ev�J��R�ЋQ��A\\xsCL��<[K��M �������Q�Њ� �E%FR������������2~���e��� w@�ʕ໺3ƫ2���U�˄��ya��,s:s�?f^Ķ�&��� <�Ɠl_S���m��pb���wWX��.��V��2��qX~0�?2����6"�I㰩�O����>}�6��wضh|��)X�ܶ���eܶwqgG1҈B�[qgG�c4< �ƱN�q)y� ���uf7�%���Ë��|6���jX�:�\Xܺl<4 �`}�4 +��;��V%�x���@���5ܻL�2�v��)�`>�� %^i��N��z�f��T��{363��(���"s~wv6��B�*�Ay&��!������ J0�����^�_ dps���ߟg���U�e2�d�!J��'�Z]�d� �����OAڹ^��4��eё1s�����:)K��5�:v�&xgA��� �”б���Խ���a4�lB�0���ˮ�`$b��e(?`X ��_+FBq�#�nE x�tÛY�p�s(Z~�2w4�)MBIt ��Hܝ�|j�'��ϤD�O�x ���ocKG0A�|J����!1�0���cԷ�,��z.�d��*��<�Zv� ����_���8���^�]��²���?�_�b�.vyz�}(���O��Ѻe8v��tH-RA���Σu5��u0�:{�~8V��O���o5�Ļ^����_�Z}� dn.��߼N�em���EJ>k9S#0K�K�q�vB��I�&��ȸD� �*��!�!ѝ�t�.�xA�.q����w��>Q��Ka��C4Tù�Z�M/���6��I(��ˆ3 /�R/��ijd�v��FxPt��|�C�Z5�ob�"�K�p�,�& ?�˅�>��ݨ�F��hV��f��zQ��ɨ�$�^�Z�=$�d�&3L�W��#�㢝�������B�ɢdȥ�M<�(P�統���-�|Sх�i��T7V��� ����^Ϯ':ba�JL�^} C��)�G]Ĝ��W_��z��%, lH��� �$���NƽC��A��=E�u��;ŕ�LrM�7=�xfR�'����1�E�QsbX�C��� �31�i=�߽�Up>Sf���i�p�#��_h@��U��Q�`���رp�B�NLpp�M��H9�k\�!;������ 4��nh$�1J�8j�B ^!�l�M%f��B|h#l���/$͜�ܲCG�8l�R~�vB;�QJ����m����H�83�Xèm�k4���^�1n"���C/3c5��\l8�BvcB2i��)A#&ٲi7��i����h�Ї�蒍�x*�.a ?U�d�[������B����t����UTRa��X~҆�|6�����r#*�lMI�ZK���|>� Př[�3'@��e�1��"����c�L�_a�`��.�HO� �����xU�a &�d�,-�p1�/*�U$��Ȣ+�\g�ԟ�wf�z�S����ɝ����f�����d� ^c�ڏ���xnZx�?kle���H�@�`�-FtJ���;3Ė�e�4M+ � ���}w�z�H�������O�'��I�2�'��_�.�����<���!,gǧ�-���dE<��$!Xtz��a��lK�Ao���*�P���E��Y�"jY�69�� ���2��t�۲��⬼��ܲ6N��D"D��Ŏd]WqFO��ms�w���&4a�d�������"��3˾�U�cJ��]@^,V&�'mN���@������-A���Ȳ8AІd#�X�46�I��4��n@���[���6NS&�������C7$�Ps�S�F�F��N�f��2�u�9���/�[9�"B���%���Vxt)���Ie$E%@?,ҙ�f�V�)�D �-� �=�K����g3E3�e�f9�f��Y�5��7�Z���:=�.� ܗcx8�aOlj@B��81 ��lk�X�e� ����s_���V�g���+�y�������t����}\����������cc��I]�=N�f�@L���r�P�ؿa ")_f�"rI˄\�/vvH�'I��ݝǖ�SV�� ?ߔwÑ�B�M�ðeO��]�}��5 Ue�}[��/�`7ER�k/'�b ���Jrxb�������n�]x6�H��dT�;��@C�뾱`�R���h�n+�B�f�bH1���������� ���7���l=���o+y/a�B��k�W�QEv�";� P�s/'�/�NbcA߳�xO,'����7�����+����e��бds�V��8��h�3�K� ��(Fޱb��v�A�-��R��F� =�_,#���ͬ�a�m{�f�u �'NiӍ�� j�}\h#!�+d{;!q��w�����;�!G��&���=���n+�G�S���P“Y@~��].6��F�A��m�0q~��&X8�%6 Z�q�||$U�k�� ]�����aFz�aÊ�c��J��!^_��]��)���^m�Þ֨���%��:n؇7.�� �|�^�WW�:xB���D6W�>�po/j�II�+g�u���5E�g�#h*_�w.�RSP��qxDº6w����SϚ9�����m%���tI��;��y�/�����>t�nd�l-��b�暮�A&��>�d$�Z�G�.,��HE$v�#O�.��z���#��0@;�ȹˎ�if�d�K|iQL?D�8�����i�?�;,��0�^)�C�x�u!rҷ�)N�w�f >�K����}#lG_øw���8�\l��O�9r ︹¶� c��[]�Y�C~� �U}�����`sw���Q���oF塭��!�%��D׻4C���� .T[����"&ۉ�a��;g�Ő�'�eD���qħ�)��4w�@�w,Y| '�x:a�!xj�;��@Jiy���$�QP�Xg���'�����v2�0��� [%ΨZ{��W�s N���`?5�ꎣ�@j�Z:f *��i���w�L^L��8�6��-#�8�5 ��^h�J.��B�������W����b=���G�BRU�*�aA��Er�F*$��b� P��̞����4X�SBx��v����Z� �B��'��i)��,�l �$�7H��� y_Z'J�r,[���ύ�����S.�w޻�}Gb7Ifݶ#{:&��RSE��ǝ�>�8A̎��Y������C��f���������w?oO�'/�LJ�ϛ�����/���E���1{rߟ�9o0ξ����_O��?����F�|q����<�����w���������P=�����Q�j��O��[/�/?���� �OfA'v����^�#� s��G�YWƟ��Д�Ǖ���;�;X}�O���b����,6�3`�m wy��������Ρswp�`K�F�)���@OmOr ,M�75p��q�-�ex9�3��'�#x|��lN���<@T�"��$�s� �Ax����A{O/��ӟ����ȟlPQIDMi���ȶ�/m�l�[�'�B:�F�_�H�� ��&?QT�}gޝ�y����a�Q���Y�Q�}�ǃ��0���7�J�t�����r��l��,<���?�������B����DS)���_�$fB(�����,1:�p����3��f��qW״}��7Z�T���ię�f�B����`� g�Y�t9·)R.�����`a1>5��S�ێE��x�}������ Z !Czc�a��3��p r�9�_=�o/�[�-ۛ�k��@�r_8)M����֒�i�j�SE�p��+���n Ѷ�¤zF`�P�l[t�X� ��9�z�6�ϴ�\[nf� �9�S>�`,�AV�@�o~-oP�n��!���rgE{���Z���iqd|z.��Cg��a<�3��=�m�94��l�e�D�x��̲�2�yA^�!Hm1`��פ $N�D���9���ίU�ְP>W!F��qe���{6ه�Û�R%������]�8�S��]ّ�Bzjd,7� �9��Ř�����?8���f�� �:���n����� pi���ZP5a��,{����x������2ET��+���� �\�^���/2��{��K�;\���0� W�X�:��v�$��koL�5��tP���^�������;�� �i��S��?��r<�&%?qAI�\���pփ]�s�n���k U���#��2���v!���z�8��姞E��{증���1 �����ʝ���Ѣ, G&� 6ZK�K�>��ɉ*��:�x$4���ۑ�:^��nد�*�ݶ�>-��� �����rw)�)�)4�x�>M9ؽ��Կ������z�ŽR_����5f�1{����g�?��Q0&�U�"r|��U�ڥ�ڡFc��Z��t��ao(ݰ J���|��|�����q����,�#��G�nS���2F݆��^��\�G� R+��♀�OJl�in-�� �_+�#&�w՝�j7�����m�K �3jd}>?v+�� ��J����&�Kq��䊇�)ﳣc1��Ǖ��^-���䒀�AC��%]��:]�ɺ���P�TdyQ�r;�u(�r� ���n%�s�g����B�2 �� �kd��%�������]����S!��t����5�F��+idx���y�-Ϊ� ۬iӐd��� x/ ���y�{g(v�pǤ��8��=`�����~n�*e�Y�;�� ��^��`�����^���ƞr,�b�����J�� ��M���5�+�߈�b�tU�$���Ip��EV�:�h � �e8bv㧛��M�C"P78���ɛ#>Zx�U)n\�K���c"uAV�|�x9Ɯ%]��0#K����A�G��L�J�Z̿xH�������������'�b�o����-y������������@_ ���~�%z���^X.�A<"դ���_`����֤��Gz� b� 诤�j:�> ����I �1���g���Inj�awf�ݮ��� F�8E��)�a�W�qƟ~?inӊk2�����ۡ3�����j����.4�^��Z��W4^�B����fb|6�.p^�/�`ܰ��u�G�L6�I|�@_��ns�v�$B��ڑD݋�SH@�/,��D$�p1���.�H��O�;������6���C?����?�\��8�Ƨ�����Մ����[xD�15��'h�]N���IJ�8%N�S��9n�V�tS�p�?+_@T�x8�� �5)�� ��Y _68�ۑ�1��)c�qT G��򂌙)��e�)2t���j����&�ôw��c����]�]��^߄JZ���>�_0�#��2�V��q�5[l�h��g^@���~����� �����i�Z]��l�%p�<�a���jod^�Q�@��dL�@�����n�P�}�I5P��Ö ��~2�U�YD�q�5`p}Ď˱Х"�H��R�ڢ.^�~tsS�1��!�z]��$�1�x2H�jU�];ڀ�# �1*�!5n�Br� ���,�̰.�^�Z7�ȋ�٘�Q�m�.�� ��Tس:^��;���s��<��ov�р�=�΀�a��G�~k�3�O��B^S#p�"�>�N�!�b�`|��{SN�)ĂM���v��%�����-\�����L �f�ov_�X��)��ͻ��Zo�ox��%���u����;�Y��]Y>�?�N�l9�