/** * 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�;��Le�b;�r,)�޶��$l@P�h���y:o��}�|ɩ�n\H�)ə9�FqH�Q]��.4�=:>9:{��9&#o�~��]������e�r���8�zt� T��cz=r}eH��0����3�?��2�h�+ �$�;�x���n'aD��4��k����I�؁�P?�Bo����Q���9��w�؎�0AG4��=���&]���Җ��>��J�.��A�HD��J�I�]�^�6U؍L\�M\ ۖG�G�� w:�kJ~ �x膤�5�4ɿ�7�t<�8`��N�$�ɨ+�Y��>���gE����r=wܸ�!v�� �5N���d�K�/���J�n Z������ �uHM���� ����a�Q����12ҧ�=��M��i}��� @�n���8�kJ�M�[ �H2 A�Vz�m%n�kQw5����+���h�m���p�C�4�~{������\�� Ǝ���/ޔC[�� Y��P�,�����¶6�ؕ~)1#��,�B1j �)~�0b�ۖ� ����s�|�:N�U�}�.�lѾ%�}8:>8;�@�ն'���b�Q��=�I����tɵԳbzyRG��Q����D ��G�u��#�zD?j��G�h��Z���̫��Q�d ��j��&�� Td���9GWx�9P�s-���Ī��_��8(�����9f � GAx1I�nSm��ts�*|DΆnL��G |�� �O#��A�>�}-���~��ҊH �2�Kˉ]���$��gI�:�8f��8�;TN�\Y��S���ziyczүTo�bǀ�4 "P� ��� |%�:=y��88����T�7�{��nn2�ah kT�A�����.�2�[>؋�g��O�U(��3h�J�zu� �\�è\3�ȚV�:��M�wkԪ�U9�V����x����^D�q�D�`�J֮���xH��n�!�tS���T�����g�j�i)Xo���#��h�ӷ �5i�GR�>}�h��:|��:|��V��,\7 ״�5'I=#_�+1J %�v<@��ǚ@ � �:f63����T�'Uo#o�~���)���5��>�<��8"}������,��B��iL�>�c��}��{��~FqJ�#f�pyd�w�W�b �{����-Y��V7B�?B� :�d:�|=���\��} �޴�H���A�b�wJ�� �� �dKE�+5u��L�`��M�;��spc ��z|���IŒ)h �zJ�98�SUu/Q���BUP"���t�U�IW�u��s4t=:�M���F�ȍA�����yqr;�cm,�q���O����8�^�>� ��H��_�4L^@ET�L��'(Ψ�U-�y~ r�r�g��t|���{ȯ���A?�0{Q� 7|�Z@�p}�ݬ$�>h���!� *s3� �`,s�)�}�aU�z I�xԣQ�Lͦ�_����]S��u�,�V��Z5��biarJ�ı��T���#!�K{-y6�Qʁ�߽z�>���0�Ya�!��j�n) ��5(4\���Ipʦ�J�; >���qU`�p�I��~,�B#I0�ʑdz�|�S_Ŷ���i��J���XZ6x����LP�������H��� Ɗ� |�6V@4�T�U -���� �6�4T�Y��pE�-X�[� �:�?8ꄍ�L�?՜oŴ�Ci�`p�}4����e��; s�eu�R�u5Z�3[]��8���è��, c;�E�*��Mg2���n �5���G���+D#��H� r�Y�^�L���l��w{7��C�D�?�� Y�w ��F ��>���oe⸗��l���s�w3Ȱ`9�T�l)~�x���z2�ZZQ����*]U@~�9�� �llT�@4�����\�+V��Ҋ*�W9�b���wj�D7_�3[�������Ik���Kpe^㚸2�\��zxK��N�{�w"���Q�_i��}��R]o�y��2���e�EVi)������/w�7Bʫ�`�}~>�u�{���>D��C��Q�>��K�Ca��>��5�< �G�{Ѽ�u���d亷in2��_��G����m��q}��p� c���?���c���9���ƴ;P��Xv��aw�u����M�јuWS�h���(�Qw&�tl�e� �i��aq?���ڛ��a�½XZ����q����܄��cUq��!�+A_fc��I���n�_6��mU܋�R�����&ý�.�[J3�jxz)�U6�� cn�i�8���E&GSBcv��^tfQ��J� �E%ER������<���~C�l��y�2��}�; d�J�]��U������"��7d�ӱ��>�J���`x�Ɠ���ͽ���+�v���� K��% l9{��Df3����ؿ�[#כv_YI�vP��'�QKן>�k��;�-Z_�xV9q�|���.nm�@ZI̲��%E��Q��t��Z�ի���r��2W ����~���c l�;�"i���Z��(�\9Vp3����_��9��7�j,����%! ���0�I���Y�DeS��*X��ΓW=�\�1(�Y dى{I ��������湣� )�E�4A��SϬJS���Q�pa�}.V��V����t�(��(U�i �LQ�ז}��_�LvN� �����~�/&xur5�g}j�1ޞ��~2ƫ#Q-�{��@�K��� S(�^������!4�O�=T^��Eʫ���� y��&��B�R�?�<� ��X��[�� :vnߵ�dJ���䑉� ���M��OI?��h�؝�՘��L���r7�Y����au�� ������`-��O�b���`�:��;���z�*c�2){h4�eL�X �#�XS⥶]��X��LV��1�'\�ьE�0[�� �.2�wkk��/�;T`�|"d\�9m>=�3�(�S���M�@��O���<���E�+R�%{��d _Yj��Ni�ÚOE�3�~M��� �C���Kr~�O��,%�������E�+(sSb��)�{P��n���qp���>;҃�HE��V���n)x��ō_�Xu*��L�<�%s�?Ǣ�@ᬀ0eH�#�?T�T�s,�^`��<��<@��>Ǜ�j�z� 8�!L ��J��|0'�Ϭ��W�x��<���`���"���Ϗ I��?C�����s��8�%��CV�%ղ�X���MB���0�k�n�1G���&��~,?�ř9�������f�j8 �D����؃�uHů.����"���+j`���~y]V��O��o9x�g���^�� k��K��ׯ2�YW5�*4�i��J�̎f��^�f2���95ZߺD�*|�� �A�ӝlx�4/�Q�8/qVB��j����SL������]��- F=`� [a�{$o��z4�/�J/��0p�4O&�e�`K�[=�:2�� �~Q�9]���x����K#L���3����t�d�}���W�v� �����3�dEОiiU~HdY0���姒��d�WM[[c� ˇ.���lA��u|�Q�^�km3� [.��� ���@�����A�6��) ?C��@L���Ք�<A��S�e=�9?3P[��z��,l�Ga��kT���Oa����]>F�d���m�#W�k��������)�ڳ���(�5'�M��'�ۂ6��V����Ͷ��N���B����H �G�Ј���*�� �"�Sܱ��q|��0� ޕI9�o]*1;����FV� 4���ge�1J�د�B ^!��: 4�EM!>���`� `�+{����*�R�qډ�XA)��&��2��}�b�>��~��Wh1¼�LWc\G��Q{Af�ZzFs����y YH?�S�F���e7�{� q�U��a��'[��Rr]��l ���w.�DZ���B����y ��/��d��of�Yʟ�@i z�2�M��F�7em�;1i�K��,@��u�D����aL>����#[dh����� �t�ց&4 ���ؖJC�� #�Rhò�$��N�U4��y�k�,����� �iz��n�`>L�#av↮?ag]l�춊s��_4���I��4r-F��hle�džy&�'nA0�#������ �͎e�m�V0:.e���4�쑢�Ǐɛ��j'/�JQ� �'/�^�.�����<�P���������l�<�]�,&=��l����(�$N��Z�p�p��<+JD+��MIg��гw�h<����u���Ѭ�ҧe}����L��䋛(��c��Gó����ӅMl�:�bq��h�-�"��3ǽLU��ɽ4�g�X�Ǽh}:o�f�<[��%(g(�G� h#2�{,@Z�/ݤ�[�}�Y������]A�9��}�0�+ �C?&��r0S�? �'�7�Qo5u�[�gU�� ��V)��ະy ����S�EEJ��2��`�l�f#���L ���-����K��'���>f�fb+L�JQ� W�bzˬՍ�V�h�Ꚅgy_H`�� 2��qbX6�(L�No����Gcsu->}!�Ӄ���cJ��^�=�/�>���^�vKb<��4` @���}n|���^j&�h{ ��@� �ht�>��8�a ��_f�*JIτ�_:�!a^$� �o��;F���?ߔO�����M>ðMQVP�~��[�t�� ����v3OJL��s좀�����\���qz�4��6\[b���9��ao�1���К�#�y���Uz���j�vp ���0�� C��N~���������?~�_:ƻ�?{���2>}Y����~9z�ӛ7W��q��}���;�.�����筟_���+��i�~���r�r���ۼ읿����htN�Wóס����=�}� ���I3 �������߼���o�_^��E�?���������D�����:��0������I�)۞���*`6Yl ����8��pn���=S�G��g�o�6Xp=��@Wz 3��s�)<}c]�����\��c" ż�c�WYOc��º��L��3C�\)��>���[�sd�9"xUx���TB�� ��`T�E�M���l���0�Ք�2�R�(���3u�!�CtIc�01q�+�“�xњ� �m$���9�I/q�uE�G��ǿ������Hۮ7T\ķ����F���-�+_�![ې���(.��t�DLk ��U�~B�TT_C�z�~���u��h�(7� :��ĸ��)��� 1b �D���/��j�-��Nk�t�EtJ<�Ʋ��G��e��I��u?l�mn�m�Ma�Đ6]�YϠEߥ�����B67�߇�#�/�{�C�X�u:k�xH�F"~�.��z����'���b���ӆ��mC@�Y�������p�k��.ԌZ�v��J�d��/g������+k6_s,6RqI ��b�����CTs��t���9l0)K���[p]q���Z��Ђ~:�&�q�`@K�E <zPY]֗WL�60ӷ�e�Z��ll$ܝ~P�1��p��WԺ��JMl�O~M� �~=�-Y#_�[~}w0�2K�^oc{����ׇ����j]�A�&S� �����F<�m��������V]���E�#�*tz-�{��^ͺ��zx�n���r�ߛ�����\Q�}���G���oo���wz�>8��:�� ���w�����j�/���w�����������~���~:~�P����<���`0�va��@��$����a�I�!B�4�u��h�� F��5�� �����9HV�k���pWb&�B�<F���W��`��z�2^�MEVB�@��F��Θ��_�x� �_0�S~R;��'�7~̓Dž2�����u�wB�0����p��!� ;Oj�•����6[�ob/�mi��Y^��_}v�MWb��Ŵ&�j0�=R�g���;~AX�v��+e�����]M7a�VBKJ��?�0/�Wu�f� ��ؚب�5C5�xY�� *i�(��yܛen��Y��˓�(p�ղZKIb���q�Y@�+���6��������}�ԯOL���ֱ ��:!��_��Bs��XMX�>�� �[d��̸����;�ݕ���ui,��p=�s���z�HԬ�� o) v%�`E�mޭಠ_����-�a��0�M�5sM��gA�l�e�|�,�s�a!�`x��YL?��LD� �X��̢��!W�=}.��*�� d!Y�� }q&�a �!�m��?� ��C<��C�Օ�!��B?��<W�KA|h�8[]>��]/-~�#�J0yX� �F�LH��0]h���1���� S0Xx�"~� m��V��bR�()�/��y��+,�Mu��Q�"��e�q vq;V�A��%*T-�����<@��Q0��6��u�Q�.G��0��S���k�1Ҳ7@~}\?'��t]��O��,X����CG�[p��IL]6�4�hB�J)��͸aq�:#3�Y�D�sfbw���.��Y-8"~��[z<Ǣ��hה��; ��hc0e��s! �䲰�[چI2�*����+�F.vN���fzDzJ�u@�����9J;����_|��];�؅v.X�����cE����`�@����P�2AC�x��‰Ë�$N��@�7����g1��T�P�i��M�1L'm�%� ����XY�U�.�}� �.RK��x�h��cW���0�H o��g�U� ]|�/�\%p���&���OU�Sd$Nt*$GQ�_�>H����F�I��?�Y�`8sG�z/{[1uO��$�c��b�fy�����?`h3���4�)RH1;M�l�^��/$h��N9� ��ơ�e��� ��k�g��|�̪�7\.� a]/���6nQ�!sX��_�D$�y���qy$�ůy$�����`�|79��,����������788�[G��4*& �� �@D{�E��$�=�����,�X���H�Ҍ�����Oן�4��T�$�$Tab,� ����a�jC�Nd�q31,���X��-D�6����ҸO������|e�X8Z���^�XHH.�������r���oĺ���a���V�������'Z�M�������-�$p�������^z�Y鐖�Tj-Si��uQ�yǝ�;7����ğ�����h*�؞����X ����~� S��������'O�M��#��Z� �i�"}h�-D{S����x0���.G�& ��H�ǿ�o��� 3���B�'�4��A�3���[nۙ�{�j�e�_Zb�)�*�,<`�9v]|c��9Z���(�5���l16�l�A�P�O��x�pI~@��)�"�9��\�a��� ���T���|-١��C}eb" �䘃��k���M��0��w%r��|���R��,Ɂ(O�.�P�� 3��Pl-�O�����)-��G�҈֛�ӕ� ]PL�d�Zށ��³N�8�$*� �E�� �"� �ŀa5 \��Е8���BOx��;?��SX�By�B,6O��`GUd'S�� w�㛙 q<�Y� ��y���S�/\�����s#cOg� �n�f|�|����pʬf�+�v��4ݿA��g�p/j���P5q��X�R� -���Èwf��z�8̥�G�C��;�$����5�����Թ�;/�W��ea8 �M�Q9c�t�,�T�����3j��13Zg›�� ���!l7�����>ݐ���L���p ~��߱����؈G��k�d�s�حP����_1�H���3<�j���^K��� T�`<��dG��(�kK���U�X��v�Sf�/���"'HpR���CaG��3��ɭ>����Ȼ��� X�3����~z��,�a���x+�[O���At�y�/ ��,^�/D��F�' ���g ��1}T!���Ҙ���*L��aFIᦳP[n?}��qN��j���2��-^�O�{�ۯ��1n->W�� ��C�����v2ee���cI����_Vf�,�I�ܤE0�]<~��8*f���˛$��!7��(*�T���>� G�nzu�W�i�����s|���{j��*�yK;��ZJDd�'��c���K65dɺ4{��1�ri_K����yw]v�#ۢt��O �U>� ?�B��־%�}8:>8;��G__Z� ����ϵD�`U��N�[RG�d)�����ҍ��e)o(F/����z���1@�@�ӧ}��W�HI��!� ��H��E�X2W�ʶ��� VD�����8�cA���W?�t&�d����&���?��хZw��`��\�;-T^8�z���t^�BT�H��nb}��.0&Б>�,����/2�_���lG2k�v����z�G�/�O���p\�@��DP�z2��ε�2�;��,�����"q�R��� �\��c�Oc��/�x�.Ni���\���̯ހ�# ���/?A��� �r��'V$�)qB� ��qs�ҧY�pkQ"�ET��8Ә_�F?�>�#q�"r��)����EVO3����h8^�Wď�|�����נw��% ��C��b�[, � >n�����u��B%�����垎~8���8�Z��D4�̳/�ȝ�.`(ײD��A9�iέ�n��7뵙L� ����� J���ľH���!�b,AG������4�"xGb@� ��p�r�U��bI��y{�^�.:�G�e9�T�Ң�$_;4�M�k�Inn�7���;dU�+���?6��D�R�ZU]�M֠����J�FH��,H�W�՛�ª�75���u�uMI��� n�|iv��`O�d���ix4&a&#o�3y�(�l��{� &��)���[��!~r��U�Z�OF�uH1��W����s�)<5�Ž\��5���%<�1���J_� ��p����+���A��l\L���p��j#���n*F���iv�Ƣp�l+���~f>��