/** * 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޲d;�r,)�ٶ��$l@Р(ZѬ���t��/������S�ݸ� EJJf�Q议[WWW_�������w/�(����E\���� �Q�&�,�������uv=vs� q>U�H�_"��ier�q�P���:�R�CꚦWDo�n� ������c�ȀF�hGT�N�6��:��!�Y�0�$�aZR1]�@ό�B�Y�5��u,3r|�2���؅,TIO9��'/��ɻL퓣�$�F�ih�>��%����� ������1�۔CK�� Y]b�w�ЌzMkմv�q��T�V[jC��B�,��=�}HJ��h�Rc��j��K3��o���GLJg�ȷ�������z1 �����(r�!#=r��MF�CW�H�>�>�XuZ����o��#�aH?�x�5�Yժ����q�6>֔� @�j� �]� rl��B �'|��r�ҹV���e�b9�����Y��F��O�T�$ �KG�쒆�V�]5���.��99� ��F��GC��F�>L< ���T������*���D��Q8�yQ�M��g�E�C+�3�'stJ��c@\�^� J�.�����AmU��?��%������*CW7t�RT.߀^����I�%���Ѫ������V�w�{� O���n� �{�Z�\+w���9�غq��D�C� �x7�A]��\ {�{��q�*�M��hz$�R0�Y)�WP_�Zf�^�~�>ݔSOb����h ,J��P�Ȃ�F�8�w�|����'�����2�"EY �ρ��=�;��h큙y�+�YI����y���oh�i�ڙg#���<�b���$��|x.�XHi.�����r�W�t�2��f�����R�՗Y��AOk}�:6������ǃ�Q=�?��� _�~�tO-?�O�2� ����Y� �ОO��zG�PK�T z)w�*$��x�R��J��d�\1{!��W�8�V*�Sh+�!\}��'��:���r���*�=%AW�݇(��OOii�+�u�M�:��� E3��|���zQɬP�H�a�p �ˮ�܍�,�z��*(<�#��T1ЮB @=�h�64��"5� ���@�%B��E�s;��)�� ZdEZŧ�W�����y��FPTTI�^\Y4�^BAT]�r�')�T�TM�~q r�vX�=DI9>ys$����Ϡ�k�(����EB_^/II���^?�Ⱦ4�3 �|�3()~�3�U�� 4�x�q����j���� ��� �w-���i�fu5۩�[ɦf:��'N\��ę} y^ڊ�hA�\C):���S���w�y�E�ϡ-�Su+�Ϣ7�h�pI�nP��S����)��a�f��$S 2/���}�+�BY�$z@T9�,A �\#��P��7 U� d)���5��:�Pݢ�֟��K߱����X���ڰU�zTv�� B�� ��-�k� tPb�I%��CdW��r�|E��}�y���]h��G� V�F�+L}�4W�"��#0B4ݢi�-Ƙ���.w��QI��7�������}���m�Y@�fA�i,R�ō���?�(��z-Q�����n�� ��E�����ʱ�ӧ���p� -%�*�e��RI�<*�oM��+K�"e��ɧOX�0��v4��G�lDi�C���O"����WAc�Z����f\xqVˢ3U@����#�[;��rRcj;fot*fx�\2�\��Z������-�K�"l c�Y��+/N����l��9���5#�ʂ:�J�V M�;�c��$�Z�ד�.��bbN��F��oR�Q�� ��u�Fb&3���5�T�C]���N��ѵ�C8cmU5Y}��ɨ*�}b��EwTC�wH�V_ TWR�5n2�X d 9�rzK��[���`{�!{5�5�u�BEA�t�c���X3����F�0D�����w�y%�t�D�R�V��B��t��1#\{�6��p�Υc�!���Ԡ�p�Z�?a�X�7<����5W��P�X��Eл� D�Z�v߶��U���a�����HV)����]j�k�,��ګ�%u"��I���o�t^�!: �9p�����͙aR��כ6V�a�,�*z�]1�vE/� &��f���Cb�LtM{R^Jz^�)����/�t`���%䵊��V��v+��@���*5MxhV�T �ج�L܈A2�o��gHI=Z��h��ۈc��T�9C��N`E%�݊�?���(�Q������|�E�S3�ܝ���J���j`�glN��V�^�Y `ŀ q0�h�h�iX����&i@��[iߪ>PhI���&ë��Z A+ý�sD@�V��x�oN�n�"�Xz���5��L�1qВVikۨ=a_��^�u#qo���g��[�'v���F��Jߢ�xN��i�tw � =C�.k�ֆI]�G� ����5�[�nd��^畭���ر=ί�Q�{ �4xl�����x ��1�C�!4\ �!/6>C[�{!�i����� L �N~4&T������9H��� ���&�W�+ ZaT�U m�W�+@v�Y�Z <WUτѿ ����C�N��*D�����) @���M��tcYi���rQ٥�a\�Vi狫��<�~��J���/�`�0H^����LG4������f��:p�U�zhh$0)����������a�NF��ֽ���u"���� ��܂픆 ���=�V��\�����"�c���a�rd���P ����c�z2�ZZQ$���"8�����sD�i�U��Q� Ѹlud21r��K3,-唳��|P�&��b�� hMt�G2HZO_�+��ĕ��*M��[X�v"� ^����HcM�sŖ�zc��ŖYD:.��,�BK���\��xE�RQ��h��^� �`� �Cdm�p"�{��`_ϗ܇���>���w�����^4���_��x�{��&��������O�6�'��%��˃��; _����>�X��mw�|�v*��e�'��� ����;W�F>뮦�����(���;�X�nY0H�Rw�],���b�:vX��p/��!�n{\��p?7�����.><${�l��5��������Т��{�Q��0�_d��EtKi�K @/F��qq�a� 1-��|-�^dR44����GU@+^7��I~�n�N�_�[@ 0ί7�˗�P,�\g�B^��՝1^���Ϛ8]$��� ��7d�Ӊ��>�#��4џ�g��6�d�Z��]os�m��c��ﮰ�]��-gO�5����,"b60ǎ;�6#�I���iO����=}��w�wضh~q��r��C����]�ڪ�iF��V��R���q��!���v���-���*HB)�U4h ڃv�3��'J��:.k��2���<��J~���ă�(��o�W� Q���T��E�� %n�Si�-M+*`�Obw^eUf��a�{5�iE�%�,,��%5Q�%M��fd�l����n���H��2%k2� |��s��d��7�n�Ba���AP��U!�Q�7�u��_d��ҡO��;�����tr5Bd}jz _��/���xTڞ�/�S���vU�N(�0�W4�Aw�B��B�����*��~D��U.��}��F�B��T�?\ /{���%���׉��Y���(�*~86�����Mn��*O$ �K�[��yz�8��m.ܴ%?�\�%�@�CR��j�K7�RZc���i�0.���E���GάK�<- �L�.�R/��ȷU�q4 �BD(t�C{�}���or\��۴p�߇�C�x��gcd/�x�H�*ZT���Q�x~T���2j'I����+�,��� N��a��G�hhk�o<2 �bz��n�lWqS�����7qj#�+_hH��*C� �"I��c��5bu�T���|>m[!��y�2 v c�P �`(�0�o&�q �8��R Q!�l�O fg�ZR|h#|�����K���U�"y�f����0��(%���ĶT�tk�S��O�aв��E���/���,�EԾ����i.6Y!.�'!��O���Skٴ~v�2�xU�u�CaL�Gt"�\0�� n������٤�|����tn���T42��7��� ��|4�-c��FT#ؚ�:������b����k��/�`�>���-��dd����,邏� �@��\n��Ne�r�I���"�0��\e4�ɮ)��J}ϝ-���M�B ��0�ICӞ�;,�V9��l$����v�>d;���ޅ��[�y�0O�@�b�- FtL���;3Ė�E��, + X� �þ;� �?RU��1y�����+|RՃL�ɫ��W���)��7�5�6�����{C\픬��s���A�'�� �pl��q����v6Y�ge��e��ԸW�+#{� '�>SG�m�]�YyMŹEm�ƃ�D�4�����<�3�;������ �`�d���_i��"����\ƪb�p�_������I��y��(�#�}p>%mK��(�,A���- ���n��-W���L���y�6����Ӕ�l�� ��c�jz*���*��oDo�[�]��H��U3I "�.�_�x�h]�P�H�RDRV��2�;n�i��I��u`Z���_ T>�N�q6W4[�jV�jV��UC��F���z{O�)x��各>�q8�a"�!!NL�Æ>�.��� @��j���ܗ�9��z�(�k�����hY���}���0����4` @' /���\��Lj��q*4cr��-Ws����� �2�E��-��Lȕ�bg��E�����zl�8[�\���Mq�hDߤ= _�� ٥��{{ S��ߦ<� ���<)ٵL��~�a)9<�\O�u����f�M9R���ak���x�z`���b��Q��W���,��W/�� |�Me_��?~����?�W����O�P{~|�N_���ן���������$������=6/�����E��W����x{�ᄊ�z5y5yY�k]������h|N���ٛ����o���� ����I+ �����݋_����6�������`��������ߎ~���/�~?����՛i�)_v��*�6����'����pa��֝K^�`��3�G� ��7�S���B�[����O��vL�Q(��y|JZ��]8f���r�6w�n���6D.�)�!��T�3�#�}E�u���l�c`t�i"�j*��)�J]���p�f<�p�n#i�>n8��u�:Dxr���������D��CN�Ӌo]�����o�����:��6�*.��H�K��p��E��U�퇭��f����ɲ��$��=/�����,����V�v�#�����lQn�t��ĸ��1�� �"�1��¿�b��w��:��xPw��6�8�=eMA�d1"��kz=�~�v�ڰ�b�B�S�t�j=�}ZK��� ��LH��>½��2��e�/�Ncm�)"��H�g��xj4vה�d��l��u갾��u�6k�8�am,�� u�^�]>1�*���]����aFz�a͊c��J��!^_��r<��)��ɽx���9�0�٥�IH>�ȧ'��x��`�w6"�����M�}�t\w���'� ƾ�_]ɏ���6���#�~޹�x#��l�X�ų{#=��b�n�/��t�� �wX�I�1�'0��A/�q �"HO��)��R����u���P�FG��ljGI�Bg����gDXW��Xf��˦���w���x�Q 'Q�h�5��#���ah��L[)*�[���ȳ��s��?�%��/��F����W��j�����%%f��^9���jfLĆ���y���]\�k �Ym�;�j%��ۀx"n<�p�s\�dc�V�:�x|�Z�П�K'bm �.�����=rM���`@�E] �6ŕ;~� �l����}pH��p> ��΂��+f]2��>o]8� �SU�c�Li�_+H�T4 i��c�.Z�T?tp�o:ƒ������rE.�ȑ� ep�ڦ��ysҤk�>����x���{�S�b����(a��HU�C{�y��\�]�u�M���u�������f� C�� l�R=�X����m%%h���m��J��U���B���:".56m��epIy�a�4���ط'.�%�j|���8]� ��gL�w� ��V�9��AK�_֟q�D���{2����j�p�Q�\TϹ��]��uf~Tt�e0�u\�@�?�w�Av>2���!�G�p�t¼o�`G B��-�0�t�p��&��oT����D �i^���c"�9x:;.��|trO�����шQ(m�NF���0"�N��q$A8j��PmTǺ���Y��W�d��a��H*�u� Q &����D��_���AN��bj�%A2�� �q�d�����T`�� 1@���8�����#c���f���?0��$� Og�R���R �+�&!�� DAic��:�%'8<����A��zkFՊ�ś�Z� hp24�����y�Ro�}j��40KR�1�Ur�-'F��{��Ep�`q��O������嫧��;_Ữ�$1PD������_���l��D�^"7��H2�7�;�$�K��H���H�x���}_,g�������:#/O���q(Y$�Ki����?�R7\�����/6�l$�� (%���/���x,_%G�ppz7�Z"�8�%v���_}�ڹ��6?�H;8�� �3]!�U<�B�I��%�ܜ '҇g))��P�<�{���W���T�)��Y�F[oR[��c ��>�D��yb�+3[nDp ����B�����>��[��w�L^���8�6��-#�� ���.�T%�+�R���ˍ���~�ʥ���I���gm#�����BG�TH�ĿIX*`8��8>w��Tq0�!��&�o� 2p6���Igx�f�x�F�ђ�6��D�3�}a���,u*�l� K<7ù�<|�t!~}w~ �ܘ��Y����^C��p���Ю:S-��]�%�V�������T����?���������� |����g�>|�>�|̟���g����ͳ�gx���������ٶ^\q�7? ������w�����o�wr����ϵ�� ����������a���'� ���k�� 1�ȴF���a:���S2��A<��ҭwI���h�=�xO/���#�|��L^[J�d�z�&��p�`���-�B��� OS�F�W?C��:��X��oj�ӓ#6Kv9�C��'�#x|bh|@����3@X�!�]:t�ܿ��^�$_Hc�I�`CPx��uuw���*��Ȱ)���[��.񅝕��r���1�.v$�9ʽu/�!���Ù��w'j��-mw�b�� Uf�D�����gA7~ F�tH[o�����w Y��ǝ��0����ԛU��շ�T�����d?����w�G�c�C�1;̚�9&O���%{�z�K��E����-D��3>z8NX����d������� ��·�/l\��ܾ��-��>�ۖ��Ά̅ �y�%��2�L�%�������� Lni�h���?����=8)]��� �� �� ���P+����]�o���K%f���kMKL�����? �l�\kl �D� ��d]��u�0� Ks���7�xc{n?=5qGz{I{٫Z��i db~.��Cg�� a<��3� |��=�ҳ��z�d�x��Ȳ�3��I^N"(mq`��ע#�A�D�õS1��]�K"(�`�x�B7O���g�#��lia�kv�[��7�1�\�!��`���(?}4����/d�m0f|�����`ƭz�+��������$����E\3�U�}'�o��ޘ��c�#�#>67m�p��<*���� M^� ��������~h�����om ���CT�:�E?x� nq�3��*^�z�_����](�s��g4���2HY��z���5)�� *��}2��7����S~EL�\c���(���?�s����F���0���6�B��jv�����{ys$"��B��☝��r-&R�d%�'�W`�Y�%�3�$M����z�ۘ$p�����ˇ�޶��.�y�/R:�񪟙*�+۵o���GLJg��n�K3$}������V�� l���q�B�(JEa_�������VQ"��F�� �� ����j:�> ����< ������q�����B� ���(oWӊu#"�����Mὅ�Y��_���9�䎿���d��j���{J|�<�xw��3�.^��A�z�%�C���.�b����ͫ ��(Q� |��/3y�_Q��lG1��F_k�tHt}ю�]��Br}a;Ѐ7 !B�hĔε���J���Mp񯢼��P>��Cϊr����17c�/��T#<�� �3J�|��xz �L<��x�M~Ⴄ+h r�X���$ *��-�*�n* N�f%3��ʗg��ӯ�����$��/CG<��I|̲zʙl�@#��� gf �k;t� ���GE1�?*�;L{�i����_���z���&T� �K�qO��t�����\,���bKD�q�� ��=Q�W^K�R��N��m����Z�Q���H��y>�:�\i���8j����)Ȝ�}��w�۽`2�(H���\�\u�9��|�#�.ą״���?��C���#-K+�k�F�sM;��M��2#���u�������T�� U���9�t���S)�H�q? �i��&3*Uͻ�{��[W#?�fcA�Gq_3��W�'M2Sa�5���aFc��ex���l��!?B����t�Z'g��!�*yM��#c��:$;�ՇP�_����3��?��yo�*:n�n�DL�32���pY� ��s�1`�A��~ b�#HC���wN�xM�r����A�����K�f���h�E��VՃ�����