/** * 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\y�Le˒�\l˱�dg�h��A@]����?�Ӽ�����)�K���q%H���3g�(�tW׭����x�������w/�4��{���qMo2��'�K�FM��=��+��9���^]�O�Rg2�zpy�L���\��B�!�i�@U}���� �8i4��i蘞b�3�"�-ߋ���;�8^�^4�؏MW�LkJ�`>R?G*�t}�V���9�� �� � Fg46�55È�C���ܓ��dx��s�^~KD�J�O�6=w,*��q<'v�|d�.�M�� ����������ٟܳͫO�QL�V��aB(6�����<7Sϡ~K�=�pp����|�n_8��_(g����c�ID��Z�= ]i x��~T#�B���G����#TuH?���GUo+����v�ˮ�Q�0����Kt>�>(Ȱ��!<�6@���� �+�_�ݏ��r�6����A�� �p�ߟ�p�Q��!��� ������R�-���8�Q���s�Bs�9 �~}n��oD ����F��qx����u4�W��(��;3x2g���� r��ʹ���ѸV�ٍh���Am �?��5�����[%B�8q�W��^��XS$ws��j@Y�����״�րw�{Qx� �{�Z�\��r��Sp�Mc? ͫU&��)�n��Z�����{��1��M}7��<�H�P0��ZZ�����Ȥ��0���g �' �.T?@[`Q��5'�@D4�ǹ�kZ�{*sւߣ���N7�l�۹gZ �-I�J��K)�BJ{!�ގH�wY'�� '��`F'��HIY#�U�����I�c���i:v<�k �#�c�~��+������ӈ�cà�{V%��h�G�1xqJ�f�5�s����� ^�;���-Y�7�a���Q4ɰ������� �s�w����z��Lឃ���������`\4�:�F��T��A]@t��h�~���\��_��a\34�2=Ř��������JZCP�J�Hk8 � � Գ��kCú�R�П9(��C���wn���FR#~�-�!��S�S�+��׬��S(*jdo/.-�/� ��A�� *pӶ_��\��(��&�9�a�k��g��5�^�U� w^ �b�/o��d�2��h�V�&I����$�ܪ4L����lD�\��v?�����Y⻎��i�Y@��;�zj+��\��Dtnj��GА�祭�V�J5����O��/a}G�w�X��b=S��Q� �Iߍ��?f]n��� J�pTo�s0� ��I��;^ ,�B%I��ʑd ZP�y,�r7ؼ���V!K-�7�q@6���� ������� ���f\�aކ��7��sFBPT@ �n�^sU���ZԘ7�;x�O�Wh�+j���#��58�B�~�ڠ�5�ae�ӧ�� ޜ���V��o5�,����{o|�r�(H �����o!>��;2�/����nԚ�"Y�h����?k%�P�5�������7����c ϲ���*b���)�� �XC8񆖒B��2�_��G ۷����%C�:F��ӧ= �a4��??��a�hJi�C{���cɚ�ߗA3*[Q���7��a�#5��O((�� ���Ç[;��2R3j;�pt�'X�\:��\��Z�` �����?A�hc ��++N����l' \�j@8�șa�^� �#?�i8 0�\̺��� ���\D��R ��2ff8q�ш�h݅lPT��_�t� �ɚ���o��+� �/Ůh2n��9�FJ���Ev�Qh�W��D2VĺQA��Z@(����i�1�&�a�f�3Y�hױ�5�J*�hǾwv�Z��|�����n�xY�6�f�i�r�C�v�Ѡ?��n�x��v�٦0pg38<1�,�s��t:h��%�J��L�v1���w��m:�ɸF���8��9I�� R�J�<2MOXt������ײ �!��eٌ�ceFF��?�fH�Y쮂j��i�͕@M�5 M�u ��@�J ����;r����`}���wJ`L�2TTˀ<��O5�uez8w��< �k=6G��UfP�_L�T�Պ5[ �.�0f���l�[ w�;�R�+���A Z �Ρ���H+�&��N�X�2&��X�-/��t!*� �wG�5j��T�W���Re#�=j�ck�<���7�:���< \��:-�8Ag=�n�R�93LK��fۦ�F8��NCou��m�u�=�Ě�n7z:$��D״'�����h�ո�~M7 �잖����k�M�V�&�,1�Uj0���nh�0���5��+�d� �$V�ϑz0�n�Ձ��(3� � �.:��`4{ �f�>(�������[��"� 3��̝���J���ja��lNo�V}�N���b@�$ m��yt�4, ����4 �z���5����no2�� �tr�8Go5ZN�u����J ��wڙQ@Z� �ꤝ-i���������"6�nd"������Q�ak��4�Eo��n����� � =G�.�wkä.�#�z�E��k���5��*[7n5��c{<�_E�Z5�)�4xl�����x ���C4!4\ �!/6>C[�ք!���L�Z�X�D��h0LPZ��Ζ�4H��� ���6�+��0cH@�J��� mE�T��8\�=F�&T����:a\k�O1ʵ���) @��e��ZE�ֲ��7 2�Ue�R�q5Z�],.7��H�K�7R�" }+�A�*����bJCZS��� ���.��_O���#U0�б�0#߾"%,��(�vo���K� ��e#d��� �)  �=�[%�m�9�_���E�nj|+ Ä���ӡā�U���kiE��ڪ��� ��1���+F{��9�IYejF|���[1"&�fX[>ʩ�'8�rP�&�r� �l�&:[�#$��'����F�k�J�+pU����,{; �߉+ZE�<�X{��R]o��\l�Ed� �"-���MіJ-������"y�/Oz]/̂=�'�����}���5�}=_r �{��P���y@�k{�{Ѽ���Un��m����������?��|���s/���|}_w�k��;`]ӷ��|���ϗݟ��>�.����\U�����F��΢���Lb�o�e� ����a~=���ڋ��a�½XZ����q����܄�ھ*����U������$�gg���C��*��G%��x���p/����L��^�j� ���ØbZ���Z½�dh*hW �E����V�np/* � �l� �ؿζ�T`,�7T�˖��\g�BV���1^V�����8]$�U�������u���1�J��Og3�lO�}M�쮷9�6��c�^t�]a ��l[�?�� ��a��E���؜9����O��-M{bt5��c��۽öE���*/{X�m{�� �8b���d9A��Y� ��f�;j�w+�r{���P w�;���ƒ�b�b��xy��{�X�M��o�las�Ak����7�O� Q���T�!�Cߛ4�J/�Qv4����<��y�U��s'�ث�L+vΩ`a�_/��z"i�w4'{n�h.� Hz�� #���d�y!\�;l��%��U���f*�6= 2��rt��j��(��:f�/�Av��ħ���x~���}|:���@d}lz����^<ǧ�&�=_~��9����-�SH�^��ُw+�-*4۟�k�<��G[^�R^��ۧ��h a,�.K���ӈ�aĜըߒ�H0�sƎ��W$� A.�p�)9�jW���G�ط�h�؜�U���L��/r7�Y����au�L}paI�r�81XK����(��:�XX0[������֩7p�2���;�*��ׂ�.֔x�m�;1�Z��Z%��� �������B������Z��� ���[x�Ww�6�\nP��u��-���:H ��������<���C�l3��9;�Q2�?��j�m?T?�1�1��� �~Si)�ʦcs��?'�uRV��ku��L�΂"����)��`��#�{KwD��v|ݣؙ��ʃ�HD������a)D��)ō�X����9�5ooI��ϑh������t u$�Lo5�?G�^���� �� w��V�7���[u� 8�t ��Hܛ'|��'h�ϴD ��s��u~.����#� h�%\@��쮐�K���1� . �?G�ǮYr� �Y�V�����@�"P� �"�i�F�� ۉO��X}�]��������dXJ0 �D�������I ů/��;�"��� �`�*{�~�CV��O���o9�ī\��փ_��n������o^�R�6���&-��������8s3aV�(~3�:6������q�t'�]��K�$~���K܎����]��K���Rt� �t�`����0�����]�s�0��� ��3�6�m���m$����z�ȥv��ۙ���:�=V������q縲�I������P�$7��:�J��b9jN ��uL2Է u&fd��'��7� �o� �r$�6Nz$x ���*�28�,��lS;.\�׍�n� �����s9�`�0:���,� ��)k�� =������@�$[cS������U�����KIs7'���q,�,���ȉd��kbb[�b�3�)�ԧ�0�X� �"F�w�����,�Eԑ����.h.1Q!.�A!����T��n��v��2�xe�u�Ca���z<�\W0P�:n��-��q��|!����v6����+)���M-?mCY>�MD�Xf�1�����p�%ixI>����L.ޡ�`�2)��c��|�K�F��4q�`Igl�g@X��BT2�*�0�OruX������J��.�]Sdѕ��{�П&whhF�S�T������n����m�� ^&c�:H���d�Zx�?olU˾�L�@�b�-�tF���*:3�V�U��,+ � U��}w�z�H������ߏգW�$�{�ģW'����3��o���m��q*v+��)]!Of+I���l��/ǖq��� .`�a��~V��Z�MNz��0���p>E�Աm��$���$����d0� ��|qb�04�!�hx�{�z2��,'�lf�7:z�����v�UE������������I��y�/P �}p1%kK�(�,N���- ���n��-w�>SM���2y��P���i�D>yM� �Ћ�1��T䟄�k������h � 2U���u+�@D]X���XՊ�!Q� �����E:s���J8�j!r�iё��P��Ņ�d3E3�e�f9�f��Y6t�k4[z��һ}M����� }��pf�T !BJ���� # ]�=�Z�e��K���s_�����g�K�:y����̢���g�#�{��, ǩ���7>��D71U�=N��@L�%�r�T�gؿa ")_e�"rE˄\�/qvH�'I����Ƕ�SW���?�Tw���A�M�ðeP��_�}��LMc���0�`7eR�k�&�a �<�Rrx��������n�mx6�H��lT�;��@#�U�yŮ��{&��2��r�u.u���}��0ח�Ct Q]a������@j �2��(��)��Hs�[�Ѻb�#<9����{P��F���t�!���"�������W�^�����V�A�E|�{c�]��r�*�����L���X���h���$��=+���bqr,��!x�Ӻ]�ؼ�=v�(7�:��|b�H��:!���8c �D���/��b�+�Nm���"� %.n\YS�Q���2�n�^Ϻ��v6l�X��y�6]�ZO�F�'����Bv67�OqW�����cr�ʬ�X��C���6�{Dp<�Z�5%<������:u��?h��&�oX� ��z�BSo6o����*|m9���t�??��=�YQ|̱XI�!5��s^���>EU��K��8>(�`����.-LB��E6՘�8�=��H�#׉��<��N�� ��|6�L�%IW*�C��W��u>������w�)^]�09�w��d�T/f���[�seS*2("��l�gF��fb6��W1��WJ�[�z�����@�����t� z����#�+�@��B�I�S���;�aq�Ѡ��P����*Uq$�̖$6-�kJUeY�Z:y6�A����*�$�ll$�f�z�W6li�55�)1�o�d���B�e&���~�a���m��t���Tś��i���� 2w�ii�Ͷ,f���#l�O�����'�$"�����-_�o=��*�nJ�R��������t,��{��ҖXd��g�����T��$}H((8���6 vdR�Ü�lj�߷lY7mSn���<��]n7�qSo�񈮿YkM��� ��� t]�V�b2yh���k #>�}w A?ȱfSn۸b�,�ǃ��/������qAE_�|�~lk}�;c���HEl�\��feR� p�W`-�|��Q��� �"�� N����� ]uE���F0�K�ɩ��0�iz�b�L|�Q�a��$���O��{ .�o<���b�����ɂ>���i��:m ��M���,/���c"t�xZ����Ǿ��b'~o̕�hx?�v׾3����z��@z����ܩ�&A8#&��_�LD��|g+�����/h�'z���:��-���t�� �r�$��!a)� X�~_ P�dDI���Jel�_`sp� �ז�חp�����O���� �T����M�(�'��Mt� �ۢ�H!p��n'� �8ذ%眪%��9}�|��|p�_�S�ɼt�7��C�ӆ�������AhA�$�-�__� �1�? l9��[��Q"�hC ,���6��$�����Z �n*������ �(�Hz�L�"��B"��/�%�HM�)�m�$�@���|����%�FG8����4���o�&I�UVj�?�W4�l$�2'(�����T�x����A��T~h��;���B;gl�����c�������k d�K(D���q\�͕\8>Ggz��3���P���%]�O���_o��ϯ~�k$CR�o���14�yL!�!��F�6��N�{�MϚ%�I8�h��`l���8�� )p�*����ђ�+�LM�;����ΐ����w��1Dz�0,�� K��ؐ�_�W��$���`Vmbrf��P�� >L��C�d�Ѯ �x�]�Lv��p~}~��B����߇��ǧ������-|��d���������=y�O�7��?�'����_�O�?����f�zq����<�����w��������h_;M��k݃q�j��O�O�/�/?M&��0�OfA'����~�3�Mk�;H��Y_Ɵ�� Д\�ǥ��軰�X{�K�m���p���m6�3aln y�c��i C}K/�wwqb[�F�+���@O_ ,K.65p��� �et>���'�x|bhl��N/NR@X�!���s�:Bx����A;O�/���W���M�+�T�PaSV=+w��� �Ks[W��i���7e�1�u;���'UnF�)��wGj����lb��WdTlƅ�q�7����-�B�2 ]�#7�����Z�8����n.��� �J�/����R���NJL7DP�_��[ Yb�o�N�C'��� ���㞡뻤?h�͙ ���H2uݼ��Os��^��G]��OʔK�����'XXB��"nmU��c�Fik_y�svT�U���RȐ�Xb� �*��e0\�{��~����Vw�v����R�7ܥNJ��Łc���b��Z�C�7j庽��L� 7�0�F��x�Ԧ&�d]-�s��C�Z�5vGm"׆[�p�B�����l��F�%���[i�T���p����)���=��U��M&�82>?��顳�d�0��9�>vƎ��[�q�u6�2L�P2�[dYf�D� /&���0��`�k�) �'Bb���� ���/m�V�P=Y!���Ie�k�[��� �����&�L�����=�8�S�g��Rzfd,��2�;G�������"�;��+f��#^B������ 4�6���.���ӕ�/�A�DɎ���x@H?Pv+��i������&�+w���ˆ&����h ���U��_T�����ʁ>�AC�ڒ.e}�.Vd��rŒ�)H*��8�@����rvՉh��W/�����s�h�;j!n��{ɥ4E��"L��Y|w̮���}׭�[�g�2�#�٥4r<����Zx�U)�o�IoP"� +@>q�c���Yx��%m Pu�� �#^�&��m-�_7C�g}/��k�^Bgc{g���f�H )��g�Fx�Gh )�~2‘{��� �+i��ځΧO{H᯸Ӓ��CL+�����C5�Q6��|��Ӵj]�����3�@3��b��U���o?-leZr gq��1�|�t�׾�\��ތ��u��� 7#C�x��������bgI1�L�����K $��6��Qed�dІ�w $���FZ��C"D��I�;;=����v�InB �)*���4� �dzs\�nH/�(�o��GC�B�e���ܣ쏋o|��i�YMx>�N�?���G$R�?~�&?�pA��499N,O�S�8����h�O7 ����UD勇�9���o�����<�/C�?�]K��g��1�8*��#�eyA�� ��v� �z�_ Ʉw�Ր�a�;L 0 ~�����7~�nB���J���+呎|���ł�8Ś/�D4���/������+W��