/** * 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�(Sٲ|I�r,)�޶G�$l@Ѐ(��k���y;1��SΗLU7n$A����3�Fq$���n]]]}œ�NO�?�{N���=�}��kz��D=��L�4j��� �&.=rF�5�M�#�S�� ��\Ϟ�D���aH�]iE��j�KM��, B�z����驖?����zQ-p��ڸ�D~d��eZCZ �^� �!M�7m�_�DL֕�:A�<�hdkh��F]�����/�Z��#ڕ�:�0�HB�+�;vmz�XT�/2q<'r�<�L�vu�&r"�=�GԳ�M^���IMd��~Ϗ�^Feod^+��P�G.:��b����qX�#s�Q�̌#_"�g����!�dL��)�mB 8^��KA��k�\���d�dx������CF�4��{���j�>`d���P[�ðz8�yI�t��<3��&�� ױ���Z���#�P%]�k���j'� �NN�qh ����#�� Jmis��xM�+;�u�m9��r�Z��{���F,�L��1#zվ�Wf�jߓ'>�<;>?�H��������8�#��sF����t�TꙌ^���Ix�T�Tc�X����7X� � �/���7UM������&�0���� ������s���݇�Rg*��Cu�bs�Wk�:dz��F�_O�� �'���+v[j[5���T���F��K �Ŗ� �GC��F�>�Ǟ��Uqd�:�2C��L��i:�*�:�� ϋ�S�{�)�X�ʑ3�'st*�g���^�nLO����Q��Y䇠6��� |ŗ_���U6��ӟT�juz��Hn6�����Q�QC�\QE�5�M�E�.{�� �{�Z�\� �� �6u�8 �I��� �x77A��X��n����=��G���~�8�� 7� t�2��Վ�B28��.�~�" K���� ��O0Ѐ�!�$O��V�C��"���N:�YU��SE���$�Q���I6U���RK�H݀��<� �fY���!+�����H?w��)S���a�pK�']U�0RYhuA�*(<�MvT 6U�!�::� kV��w�?r(��CBP���=��h����:�r�P�S������ �z��{�����͉��^C� <�~��{Q^ 3἖�EB_^7Kɻ��^?�趲�3 Ҟ|�ӯH~� �U��� 4$y�G�B��u?�����I⇖���4@��Z-vj��V����)�����*��А�畭���-4�r����?�_���r�yb�Sh��\�R�� (4\�~諑ƻ�J� >.�¬*�9(�|V���W ��PI�r$Y�$O���R(7�捀B�Y*aU�☣-�-ZAj�y����Lݢ [�K��DAP1��{-T!��+L�����FC��5 �����Z�t�] � mP�]�4����h���t�J䍷c����zxg| �(H ����@��OL����b[/j�%��HI7�r�����Q�� EIxh����W ����g�{�C�d���1��q�XA�� -%���e��JE���!L����i�1�6�a�&��a��X��Q5�G��]^������a�a��?��$�u�ޮ[�„�д��u�'�>,��!r���|>E$��unU�V M��c��$]���Y�!��b�JWu�IG��k���R�>-�H�dA�2V��kz���T� }?�* 0��b0�V���*����?b3��,�A5�z�4j��@u��!�Z� ���@�3n ����U;X v�rP�[ `\� TTK�<��O9�51=�6T!z��f��o-2����N*�jŚ-� L�*3µ�m�]w�\9�R�+��A Z���z��%�����u�J��2&��X��.��t!*� ��{��k��~�������*�ߧ�޷��.Bk��:]Q':���EЃ^S��2�Y@Ϲ�[�4�ۜf%*z�iӁzf�%덶lmY��&V�fS��!�Q%��=��$���vQ���Wt�:0���2�lh��^�n�^b�� �Z��iMY�Հ�MYגĭX$sm�&��~�T�Ckˍ���8F�YU�$���T�Qߗ��sh�B�~м����.���H��,�Gk �@��_�9]� ���*1���4�4`����JӰ0h����Ҁ@c_nߨ>PhI���&ë��Z A����sD@�F��x�o��7P@,��̍�M�W%͔8hI�[��6j���"�e]7r�)�FN�~b[�M����-z�7�t�vNw����� ���[��ol��E{�P�[O]3���F��u^ٺq�����:2h�8��7���`K����k�� �����J y���:(�� �Mk�u �0��X`ZuB��0Am4B:ZR� �����k򛘯6�@��P�u m����5 ��T�V ���3a�oB5�������5�$�Tc���6�H����WS+)�XU��AN���J�0�F���+��<��ҫr8OC_E� a���;(9댇4��a`\`J���:� �G�`�c���|{B�L�Q:����2 �>�#d��� �) � �#������\U���{��1���a�jd���P ��x�r=E-�)RP[y�]U@~�9��t�hnU�@4-�M&F."�MF��� +�G9������l�n�X f>��-�� �6ē���ʢ� qe�%��C��𖖽����oE�-��8���B�����b�U��˶0���J~�E�Pj%^o�T)�(����ti�<�]�l��B�f�q����P���܅ڝ��=��݉�-|�ݫr�ug��Ɵ�]�����I���ļ~���r/>��7�u�@����� }�-0�§݂��|�� n��nC�6���U��Ϻ��m�n-��>��$V�� �9���K�n�����!܉�Ml�W�.܍�m(m쫊���^ �2�yM�nvv3��>�l��N|�b,��Dv�J��R�=�KQ��A\\�sCL��<_K��M ��U�;љGUB+]7��I ~�n�O�O�- %����K �@( ���3�!/W������p��WM�.�S�����i��~ķ�f��� <�Ɠm_S[��m�M6t,�cw����6���Sw� �8,?����#ǝt_����~�дG�I[�?�����ضh~u��r����3nڻ����iF��V��Q��Gi��!��v�qpX W� T��R�������C����L6-�qYK�ORp�O��s�}�/_،=h�����|�����0�(��A��[�81ʖ��0�'�;O^�ٹr(�^dZ�sE���������{G ����� �d?U��H��22V2� |��s��l��7��\�¦;D�ӛTa�J&OQ�7�u��_�L��������=x~�n}|:�� �>3=���؋b|:�jB�s��'�^QܮJ�ҘB x�A��.Wh3��|*���$�1��,���}��F�B��T�?\ J�Ҷ��O]�� 6�� ›�1�-@Q�|Y𻳳Q�� ���[x�]t���[o�O�`���z�n$����DNpw�����{�*�ֆ(�Ÿlku �m?�}�#�1����z���P�A(���؍r~0N��,%���:�L�ւ"����)�u��ԝ�,�mLJНE������D*"���{ K!�k��(n}�bݭϙnxI�aI�O@ᮀ:0�K�#Id*x���IG�L>O�/и�yk,��i�;JC���Ua$��)�:� ��3+���s��u~�ocKGpA�|*q ��w��\ˆN\�Q��2�� �=~Ȋ+P�='xH��>,} z�ve��ţ���?����������s���?{�y(� �Ѻ�_v���GmRA髫����u -��5���1�./��G� �� d�\�������Ln����z��DC�Gf��;/��۱�΍��cj}� ��k�^Q3�bneYKWE%Q��J.0�CRW���<$}��r)��1jG�2�KTE�����^vHXr���]!�^��o+P�X�LDs��r�=��2���dP��K��0��^���5����^����4���C������� Z�Β�*�rϼR;����f� �A �33�8%z���D Q!�l����pZ���Fx�ϻ�_H�݂܊K�Qr>f����0�)(%��ĶT�t��S�LϬ�߲�5�E���/��7,�AԞ����\j8I�����l�=/S�&�+����w� ��U�֡�!��T2-a`~v���wa2N`gqO��>����|b��'L4���7��� ��|�2HZ�*ˍhR�`k���G҆�拹R�Z�l�knBl�L�1E�0 dl�H�&C#ŷ0� �`I�|pf@Xꀓ��t�3��0�CT�ò����G�~�P�E���t���N����� ͨC ��=av ��=�P�sv;�>(_�b��I���t:9�.���0.��E:�;�`DG�H8��yg����A�C�,+�M X�J�þ�� =y�(��C���g�ӗ��(G��ӗ��/ϖ�s����P���O�� ����t;�P$��)���Д,w�IJR���RR����v� �Q�)CǶ�dҬy%��e͗�ㄌ�<�)���� ��»�����1 �`d�y��i�&=���T L�7���R� �"is:�~�a�:��7H�(�,A���� ��Ge�� ��>�����m*�<ǝ9��#C7�k<����tB䟄ӓ��Do�[�]��U�7y"t��@D�Jx���V�z�!ͣ"%@Rɤ��MҹO�NT��L �Q��E{���D���XM����� W�RT�"Ԭ��6� �����ZM�;��$�qv� 2�2��<0"�Q���d �q$�T�Z�}�<�,?�%�bm�wK�-W�ɨ��� ���>\����D���H��`���I-�{��,XA2�Wj+��ڿĮ�$��$�� �XD)i����K�IR:��nw���<�Sq��w�޿��4��;���K�������-�`�ERI�]N0Ǟ$��+����zN�P�K{��v��LA�^��i!l ��/�� ��Y�8J��j����_�u�*`?�A�������������� {i�������Ϯ����o?���ɻWo�^?ۏ��·�+��y����.��y�y/���g��k�◗���E��uջ�p����育���7�����|��M�]�o�z�������O��6���Nj~�K��������?��ۇ�?;�շ�6y�f�}̗�� �M+DBkx�Pw*�pa׋�=�,���%R,DE'Е�@O�q_t�o�+g���dڭ�c��B�g�ס�S��xT�4���)��f(�+����a�T��l�8�� �zL�#y��_�v�a�/�Ct ,��0O� K��' 5Y���]�Ќ��m%��Í�1�T�c�'l�Z��*��J4�̜@ C�9ަ"��r�������I�M��o4�U\ķ��W0����5��ߨ"��[��� )�v����(I'����yq��������7Z����k��G�e���΁s�V��8j��h���K�� ��(F��b��v�^�-��R��m# z�#b��;�7���m��-�-�)t�8[M7��s���i���lݯ������Cܓ�m.�,CNx�MkS�O�V"��.��FcC O���`��lR���{�C@�]��� k�`�D��,\������T��]L������3�#V�s,WRqH ����y7OQ-L�Ce,�`���.��q�g�� �'�3%�{�Æ�/~̏p�> ��p�/uw�(��4�'�Y����P��X3�V򭪡�JN�m��-���N��[vb�Ao2�&����/E]���WIl��|��WY6�4!x�?e�끼�c���6� qv5��%Ȁ��[��*x�7 |� DE��:U.�3�X�׷���`;2��/��m��5���7]_�/z�-_) � v��!MwC���i�Q��[8�<^y ���MK!���7oj �E� ^~h���Ӓ�2�~�#\�����BӢh NH����3h1z �0?�4$ L���&���L���!�����z���z�C3"cJ��8~��0=r���QӽEU��v���V�:�� ǀ��� '@��我�Eޠ�c������u(�j��m%͝������n41����`�Xe���Zh�9#�֌��@�_��fd��9^�A�' �L-��؃��0���+�'t� vy�!Vz�N!�"�9�df�b�ii�]R�L`�buK<5Åu�By)> ���>���`�-8�_3�`� �]���@�o��]3��x�C��[�!;�==}?�~y9�������������i_;?��?oyƟ��g������o�x�ⷳ��O��ٶ�_s�7� .�������������78~��O�!�����_4��__ �n7�OnA��s�5�ڄ`7f ��(��u ?�̟�TД\�Ǖ�z�8����@�=:$�^~�S"�������&� �n�mW���b5C3��f� �P���k{M��~  z��J8������V;*l\۲Y��n���O�����ġ�� ��ܥ� ��?)�Կ��i���#)��4�՟6��?]W�7�?�<���ߥ\��v���.YZ�-,ƭ����B�X�/"l�y�{���J��x\��@�C@��'=��w�Q�̽��Cߣ��[J�m(��F#)}��v���\�o�Gc�g���#�1�d��A��.������=��j��y�p���CrЩ7�QB>�OM3uݼ�����1�QNW |�E� �����'XXJ�� �沴*�#��E�������Ư {�B�|� �L�g!��J���⾒��Zfnޤl ���w�O�r����$�S�!��,@5ə�"o��1�~�n�-�n�T=� mܗmS�o_(�N�0�~&��˵���Mr-o>��(!6gq��<���t�~�G� f�MlI/%"�3O��� 4݅3�����}���}��u�G>-� �$"����H�cZ��p Y�l��>v��[�ƩM��9��D9^#�e���^Jɋ#6ɮt�ȁu�.���<��J��_��{8J,�.7 kX��99���eJg���ӣ>�̿��������� !�vO��G0E����\Hύ��&���Ф7�| �bu�����[3�����n�{��o�8%0����$���kKœ[��/y��ln�H�$�"*��ظA^�`.�d�p�^�mQ�OEA�mc8�V�X������������z|��0�A����x*uo�T��ї_�L+$� "���1��H���'-(��C��Z� ?�z�ϙV�C�N�p@�\����#��4ZO����ȷir��w�[ �1���O8S۹�;�ǽ���p��ب�o�&��3U���:��;��ś�:�H�f��� �~K��>���T���L���:�p�$6�KGK��� ��M�����n�Jn�)=!��g��µ@xSIvb��J�;|�^���`4sPœx���\�W Q���+Y_��5Y7��2�|'$�~��e�d���Y��d���ƃQd:��>�N{|�"$].�{��ʛ|�)�`�T޷��+���u+�ߖ�.��7�\���F�'����x�$�Ӭ ���5�2Rd{'I̾D��M�v�~��:,'� H5�qi{��()��� ��W���w��U�����+��W��^���d9�T1j���2�eO�f�&� ��d�Mr�n�В-�${�#� G�Y^�����p��^�#e7}�lZĺ��(��?���`���Y�R"��l�Y��,�w�Y����w,������!��!o�����`g��x�/L 5~���x� �f=nBW���")AIT~�[��>�d g@��IQD�'�1e��wj{���0���#��&>Y=��6�J�DYQ�33�:B��߀��,����d���ô����/����k}*i�-}���D j�u`� �� k�X�hGc�BRd]��XW��dL�~����c�iҫ�K�ă�I2u1���:ِ6�Nyuaʔv1�;�;�xOZ��H'�%yj�����fՙeF�;��i�v�����R4�S@*U���9�t���S����D+�iu6+ ҄E���N�LՕȏ�-�:h-�{�V����z ���;��M4r��L�E�n� ��p�$�5mқ�����į��� =���C�s-=���%��y����)���X0nֵf�h1��H�0��þ/8������ A;�4D����M�W�!��F�Fp�I� E�'z���;zsY��v�����þ�