/** * 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�HQ޲�K�r,)�ٶ��$l@P�h���y:o��}�|ɩ�n\ R��df��!���uuu�����O��~}�����s���_�1�Q_��|~*a5,r�Fs�ؓ���ϯ'�+��=G]Ϳ�ٯ��}�v��q@�}iE~ح�=�����h8�G4� W1�I}�˦�Fԍ�3�nX�5�ȋ G6 sL��tP�֑���t�/�D��/�f`��8��A̱�4�K�g/�]��� טоtiә��Dɾ4��hܷ�mR��Ԉ�ڑ �C�ph_�h";�N��e��/^�m��+��z����u��%�x/ wb;�J�'ƈʠd����� ��T�];�| ��)hL#O"���)��'�0�J�n*�v�tg�2�uICUU��h-��T�a�P��c�!22��9��5�S�c����FH�G� �>�?�Ce�x��S����Tc@?�Y�Ou���J�S��_u�Ou�&P^�������Ⴢ |��� �=�_*u�%h�`�X�r�~B�j��3��%0 2��3}vI�~[�(�ts�>"gc;$Cۡ����#��8�P���S�DS��5�z}iī�5ڋӉY���(����N}��g4��.�E����߭�tF�qU�4�)=V�7���!�9��Ԧ�W���x�NO�)!z��=�W�j��b����MBޯ d�*&�|�fTQkj � �E��>y�]Y@j� ���Z�q��sp� �0�y�*#� �x7�A�XX���=xrO���� h4 \)�`^I��W�������7�T��X���F�� % c$uEAD#}�Z� >��Ƨ鐪�OS]U-�l�"-����i�Gy����<7�bG��>}���Y>M>�v'�g�[�gZ�)H�L�g� )�BJk!�ގHW{� ���u���B0��h� ����Ȫ� ZZ�øֱQ} 5�.�)��葽!v>_i����sjz>}�4���*h�Y � ��d8/N�{� �1L �j�V � �b'V��%K՚����0‚�!�T��A[�!�ˀ�6xg�}��Tk^�b(��}v�/� c���VU��!\:����u@��f�G���H?���Q��$��)�|�8�]U�)a`�A� (<�#�f+l+ P�:ێ �L��ob��܊a��"۹�r_J�����Ț���5W�8�_�6�� ������2������e�OP̩�V �zq r���{��t|�����o ^�A?��{QV 7�y- ����~��v�ϼ���}��3��|�=�H�� �U�� 4$��ɀ�4%�~@%��~⻶��UU@��Z�vj��V����)��Sǹ�0fACB���" Z�Wh(�@��<} ��N�,� �9��j�n����-(4\��*�wʺ�J�; >z�Z�f`j~���ų� X ��J��D�#� ���5��]�n�y# WE�D�JP�]�`� -��[Al�i���l ��N�L�� ��OE�"�����݂�f�A���6��w�l%S7�(�WTX��Gh5mpЅ�)|dڠ�6�~i�ӧ��5ޜ��閕Ho9�4���ڻ7�Gd$w��x���[��G�� �k��g՛���HI3�r����R �Z�( ���ܼ� ��E����.U����Sp 3�XA8񆖒@U�2�_��G5�3�����%C�*F���� �a���?;��a��pLi�Cl���M#���ݓA*�a��7�ua��z%�,P%4m��vXe�&Բ���O�"��d������������-�O�"����WV�\oomYv�;ƼK8�Ȟ`nԃ܁X4�k.f]���u�f�y+��I!��e#�n��DU��B6(*��l8��dUYā�7 <�\�ЗbW 4r7���� �%��*;� 0���&��n����C(����i�1�&�a:F��T�hױ�5�J"�`E�{q�Z�6=� ����a/U�,Rz��0{܄����i�݃?���1��r#[�lv�'ƕunV�vM�;�c��$Mi4IZCL>7�)�ޢ���k����~����Ɍ e�d�#��E�k��x^t-��N�X[��Ї>Vfdd9�mj�EoTSntI��X Ԑ�]Ҩ7o�H_ �#9�rZ[������`{�%{u�]c�����Z�����a̹�����(@��� v�"�|6�#P)V+�l)�o8T�����k�r�K�Ҷ䀂_ylu��r8g �כ��X�;�<����U(c`(�E���"�]A�2�xg`���*�s�0@Uw�6�UJ�l�~�Z��\�; ���tI�ph��� Z-�8Bg=�n�R�9#HJT�Fˢ�Z0�vMkvj�ީiU�>�Ċ�j�v5HlV���O�KI5��Ϊq9����@ػjB^���nMk��R/1 �`�y�R��ҁ�VMMՀ�����čX�$Sm�&��~��Ѓ�vj�6���8F�IUs$��VT��ح��Sh�B�5m�uy���93����Y0��$�i�&V|�洚�c��U���V �����&7�v���A{{��n����έ�5����no2��t� �3��8Go5ZN�u����J ���[�Q@Z����-������Z���"6j���"���S����r��.���H3_��o��6���ܓ�ec}��e���0����$��j��,F�3�@k����[�hb[.�WѨ�V�����ZR{I���Y�!.����b�ٴW]�`M},� �N~T&(�f@'�@ ��Y�mE~ �� �6@芾 � ���d@Z��.aq�,��� �P�u�<�Z#⟢k1.mQ�$8��>ZjI�����)岲K)ø����1ly$�Ъ�0OC[F� `���;(yӝ�i@+��q́)y�Ы�����H`���w�����^4���_��x�{��&��������O�6������˃��; _����>�X��mw�|�v*��e�'��� ����;W�F>뮦�����(���;�X�nY0H�Rw�],���b�:vX��p/��!�n{\��p?7�����.><${%��l��5��������в��{�Q��4(.2܋�"��4㥆��Ze����0憘��y��p/2)��U�{�ɣ*��܋J��?[7H'���- %�� e��%�; ��l��+�wug�We8���&N �)��|� Y�t�8�M��m%M���x��'پ��{�m��pl���wWX��.����Ǐ2��qX~�?ۙ�����q�T�'�QGU�>V��;l[4����rf[#�b��]��R �4���V�ڒ� 'q��%��Π��+���*HB)�U4l;�N�1���JŦ�.k��"�ʱ��<�� ~���ԅ�ȋ��o��l�y!� C�;h��΄Q�U���?��y�U��K;�X�� 3�/�`a�_/��j,i�w4#{f�h.� Hvc�F%�)Ș� D8߳�:KLV�Xs�*�6�%2��r8�_��s��a����Y#;�t�Qr��<���>�\�GY�n��烩M��<�m����Թ��]���S )!��!4�ao�B[�B�����ʓ�~D��U,��}��F�B��T�?\< F�XM�[�� v��6�hN"�@䐙��� ����K��3�h�؜��3��-�,�^�n�f�/W����{����e�Qa���åaX�4ܱ�`�*i�+��j�]���eR����eL���\�)�R��vb,�Г5 6�� ܛ��1�-@Q�l�󻵵V�BT� �3�`?�Ww�6_VP��u��-���:H ����l��<���7p-#��%;�Q2��dku�-/��m c>i�z���T�@(�����`���IYJ��Ա�0�; ��VP����]&���-����e{���=�\v5#���-C��R�F�Z1��Xu+�s�k�ƒ��_B��c��+�Li�H�2�j  ����?�'�Gh�yޚ�П�ު�T�1��[�XF��4�S�>A�|&% �:�X�|[�8� ��P��O��������E!����s�u K.Tᷦ�!ղ�U�������^�i����v �_Xvt�����\��u.N�7�%�T��� ��G�c�^L�"��L��<�PwP/X󭳧g����0���˱@&��_j?��Q~� d�/��߾I$e�t��AB>[1�����%�xr3V�"~M}h\"^>��|�q(t'�\�oK�^��pK܂������#C�[{) �1�G5� �E��b�ec�GBq^F�ax��z�ƞ%C��e85ƒ� �S�8Ԫ|�#�]�u�Ç��R,���+>}%�Q׍Ʋ7�Ѥ*�w�j��� d�אQ+Ir�$�Z{Hd�4Mfx�/+=>��C[[c��WÅ���D�PK՛xJQ�^�kc3� [*��� ���@�����A�6��) �� �]Ot��ܕ��G��@���s���9�կ���� X���kI�)��k��σ �#r{� �`w�+ ��,n2zL��#�Y��1�E�QsbX�3��� �31��i=�m�l+8�)3��L�4Z8��/4 bʪ�J�|�B���X8w_& 8���&nk��5.吂��(pT�_B 70�%z6�?!/��q�ʦ��@m!>�6z`������NFn١�H�Y*?v;��(%F����T�t{�Q��O�a�6��E���/���̿Eԁ�����i.6Q!�)!��O˔��kٴvz�4|�xe�u�CaT��t<�\�0��"n��-��q��t =����tv���TTRa��X~҆�|6�����r#*�lMI�K���|>� P�[�+'@��e�1��"���Jc���_a�`��.�O� ����x�T�a &�d�,-�p�/*�U$��Ȣ+�\g�П�we�z�S�����]����b����me� ^c�ڍ���xNZx�?kle���H�@�`�-FtB���;3Ė�e�4M+ � ���}w��$���c�����W�$��ēWg��N�S��o��m�ٱ)v���)Y �g%I��b6L�öd���|�� �yXd��)���o��^!���-3�N�<�- �*��k*�-k�4L$B�)_��X*��I3�e�=�N=؄&�� 6� ��PD:ط��XU!?��.٥��be�y��t޿�r��Χ�m ��E�� �6| ������M:��^�����_$oQ �88M��&�N��ݐ�B�AOE� �^����h�N[e�� s^�_ \�r& D�Ѕ�K�����R)��H�J�~X�3��<��S=�B[&x����f3%�f�fb�L�rV�2W��kjGo4��NS��u o۾���I{2J"$ĉx`�0��e[��(�_^�յ��R<�wX�OCJ��*�=n�.[ 瓁��AB���qQ0 �S���n|���Nl&uQ�8��1]�����B�_`�F�%�� |�!d��%-r���!a�$��o��[NW=�7�|S�E �� �7iÖ;YBvq���^�PUvȷ%���vS$%��r�)v���=,%�'�)��wS�ló!FJ�������X��9��������v�?��]� ��������/�W���_~8=�Ǐ�+K���Gg�>?� O_5~���������������j����96.�C����_���+�ݩ���:������ec�}98������9 ߌ����O��z����٨e�o���ﭟ.߿��y>~}������?^����������� ��ף_�����_��~<�v���� �Mf+DBk8f �;%,��uѺs�� �C��`&��:���z����S�}g\�#����Ҏ |" Ţ� �8�OIKc��¸��L2���@��֮���í4�f��>e2�E���u&u�M���}��0ӗMt �]a������k 5Y���^NW���m$�1�-��p]�������}P��F���t�!���E�����v��������:��6[*.��H�K��`�����U������f���ɺ��$��+�����(����v�v�#��s��|Qn�t��ĸ��1��0�"�1���¿�b�����:��|Pw��6�8�AeMA�D1���mz=�~�v�ް�b�B�S�t�j=��ZK��� ��LH��>����2��e�+�Ncmi)"��H�g��xj6wה�d��6���:u��{�:t�5L��07 �x��…��h�.I���b:CW>���~��nX����c���Cj���l׽}��0��q|P� � ����d3�l�1�q�{����O��Iq‘�Dc���d��C�T�X��sC�VW�e?�����o��/)^J�0ȗs����X�g���[��bc ���#�=lZgB�&9h�=W$��W�K�EEV��<Ӵ���mYmuU�����R�A���2�n`9r|�1K0���6�C����6�D���ץ2�d���Ħ�3ͥ�,k8��#ׂ��5$�X�����8 w��`=�+�t�����o{�b��A����R�����M�Ī�#il��=k����=|���l���%��d� n]�[�1s�"���!��@��c��޷�TK� ��zt�w�i��~R ̚�0��]�&+�M������XL�:"k� u��.��#�x������3�����zd4�C�I�:ۢ��?N�'�� ���e�m�م��F��F�zX�妞v` .���;����2�����\a�"��s^��e�r�W�����MC��8�s�һӸ: �Ew� �#c�b��J�,��ys����?N#���O���w�8`>�K|�L�>��cG�dp���.Al���r�<�r�mҩ�t8dצq �4�-��9��X���l�z��"�Eb(�7��<0�q D��-��z��ccX���ą* ���A�a;q2 B�Rp�)���0@��8jRJ;z�i1�z@Sw�`?+��� K!�����+�����Mb �嗈���:Ùt f12N pH�n'� �8��5֌�%�s7y5=��h��� ��ʡ�;�v��c���c���YN�8���k�`��4b��Qg?~K7�I���W_ ���DG��N}z�%��^i{�L̐�"����� //$/\ �Z" �6�����<�m��5%�QtF^�� ��L�ҰG. {��n�$9VY��_�t0���pʜ�H4�7� .�㱯x���Q��<�4ߙ�#~�Yh�M�|�#p���'[���t �l'q�H4T����� '‡g)I�W�8�{�v����T�)�c�a[���ձ�~voo���1���m6<…~ch_!�EliO�i�^�b&/��E�x��–�wU� ]| /�T%���BZG�@t�9:��/�YB���|��U!)�*���aA�`Q�a������+U� g0���^r�*�F� D <�b�D��6}A��@���2�߀�ՈuY��Z#6��v��/�.��N9� 6=a��FPؾ�O�G�w��v�f� ̪];�d��j~ć�l��v�e��;���?��5���'fꏯF�!��;=�8>o���g�?�����c��~8=s��6�~?�×?��x���/F�|q����8�;ߋ��ߍ�����ɡz<>W;GÀ���>��^_�F�~b�̂p������!Ĉ"����/�O� F�`�K��%�wns���G�}��>p���,6�3`�mJ%3�m֚��W(Fz��A����NK�F�)_��@OmOr ,M�75p��i� �ex9£��'�#x|��l����O6@X�"�]�t�ܻ��^�$_Hc�I�`CPx��uuw���*�/��)���������ݔ�=r���YH����޺�t��rJw������5O����?0 Z�z*2Jv�B�x���~/~���tIGkˍ�.wv�MQ�����;7���̝+���h*����=Ib~?����w�;�c�C �.ۡ9e?mL�>��5�G����1��I�8Sӌ[��0u�l���t4 ��.G��#E�R��o�,,&�L�mQ_ج�"��^���to�m�J�� ��!=ð�0c�Uƙ�`�9���������-g�mmӵ�]��6\�'��◲�c�شdq�Z�C��j�B���;*� wT0��4�7�q�a�E���p���c�Z�5�m"׆{�p��D����,��A�% ��{G�T��=���⒟�YҞx����&cZ������Yo2C�D�b|;c�p����:;]&Q(�-�,��d�@��RF[ Fs0�5阅}�!�\�τdy緑p +X(����Ӹ2�9��X�:�X��ux�[��+7�>�\� ��`���(;qTHO����W2�63�\�]�G�?g� =��_�{=� 2�����_5�����o9AՄ���- x"Fߐj�&7�T~2��F%��i��q�,<� ]�Q#����[��������_vΑ��ī��� �W�e�^bt�F��ʞ�ƛAIr�F��gK���U�X�u;�13� ArP��E�[�e�$79�{�UP�BIF}��ȇ�{2��{�g� ���A|F�y����Vַ��;����q*�_��X�y�_���r)� O89�=��c�U!��̦!ɲ�%�\_@����P[�0�P�0%��H5�rh{�/ɻ�^n+e�Y�[�� �c�ീ`�����N��䲑r,�b�����J�� ��M�.���o�=;�*N���i��$8J�"��Rd������21���M/c�|;��G�s|���Gjo�*�e1;�q�zL�.� ��/ǘ��K�5gdI�T�#���70 �Zi[���mmis]v�[����52╿�2?�/l׿%��>�~�y/���B_� ��Z�W0*�� ��% �+I5)�j��xb@�5)�h(�(��A�z���@�@�����W\�G!�Sz�1����\O��awf���U�r]�����t@3����<��ӯT�mYr�_~{�2�|�m���=)>U�\������ ׭B�x������]�bq1�L�/��� t�O���?�ٗ��,��I|u�+��ns�v�$:oGu/�O!���lh@���z4���R����Nq�&���@<����}����1���Kٗ�o|�N��%x>�N�?���G$S�?~�&?�pA��499N,K�S�8����h��75 �[��XD則�) ��/�r���4�/�?���I|̲zʘlG�� cf�k�t� ���GM2�?j�{L{�i>����_���z���&T� �K�~7"�t���Z.� �l�%�Y���OP잨_�+�'[)e%��v{�]��l��z$p�<�lP ��E�E5���H� dN�fڰo޽Eޕ�TE98l��*�&sQ��E=� �i��#v҇�.)GZ��j��p�v����iD�� �'�G4���A*U�����ti��Q���q? ��i��&3*�Uͺ�{��ې#/�fcB�Gqs3�wW�'L2Sa�u���aF��bx$��l��;6��� �p�� g��!~���F�� Dl]���@�ŮAg|��+Nؼ7ÂM����.���!��eA���x���0� �l����!R�}�;'��l�����dJKVuY�%Z��ht��E�ٖ���_��