/** * 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�Le˒�\l˱�dg�h��A@]����?�Ӽ�����)�K���q%H���3g�(�tW׭����x�������w/�4��{���qMo2����K�FM��=��+��9���^]�O�Rg2�zpy��󟹎��LC:J�8�A�����N�AH��ULC��T˟5.��zq#p�NjM%�c�U,Ӛ�F05>G �����]�s$3J�:A�<�hlkj������K�'�F��3:��z�a,Ar(]8v<��ܱ��^d�xN���2]:�9�؉A��sץ�㑱��g�W2�B�%FO&�f��58h��N��8�I����Kř���F���k�����2M���!r�� �9�}�8�d�S�O�1�N�n������X � HSӴ���m�'�' �j*��p��"ddLck��+o���H����/p"�0�aVR2]�Lό�D��l��Xf��^#���.g.d�J���y��@��,�L�5%OC󏹿K^RjK�����_�؁?�A�E�rh�r!�k����� ��0ڍ� �%bd�(FOap�"[��{ ����r��?���2n|6���k4�%�}88�?��@�ml_8��_�g����c�ID��Z�= ]i X���؈� �'�)G��C��� l�mUS�]�k|lH� @y5�&��O� 2l��GO��Pip-�+�a� ��+�#:bdzܹ�t?G,�aP��(/���4vԮjH77���G�d�Dd츔�_�Iʄz4l���ܳЖk��կ�͐�r$��$�X5Z���+���y�~��Fq4�r���ɜ��G/�! ���;�G�Z�f7�Qh�c?������|��㣷j��p⌯jq�~z��H��&%Ԁ�FU D �S+�i�&û遽��gH_y�W���=�j����w���)�ᦱ��U��� �x7�A��X��a�}Qw !�wϪ���h</N�w� �A� N}ਐ �K�k�Iܒ��lC4� ��qH�-���V�Cx�2��޽<�n�?��*�=%A��݇H��bP4�:�F��S��A]@t��h�~�B�\��_��a\3e A��b��c�{�U�wc5 �!(T%�~�Ɏ��� ��샩��аn���.�gNʭ��/��1���$G��E��*>ɞ*\q4�fm>�BP������h����:�2�'(Tਦm�8�^;Q�=DM:�_����,� �9��z�n)�� (4\����̺�Z�; >�z�.�s0r�{��~��e��$�Q�H�-H�F �� 6o䪨U�R ��5���Pݼ$֟��s߱���ތ�4�۰U�Tt�� B�� ��-�k� t\��@����xJ�B�_Qcm|����A:��+�լ� +S�>-��ys~F��[U"k��������=�A � )���W�G:���x`��ȴ���zP�YPk�Td1��f������B��(J�B��ܼ� ���1<�������ӧ�.�c ��ZJ Uˀ�yȶo�����%C�:F��ӧ= �a(��??��a��hJi�C{���cɚ���W@3�XQ� �7��aţF%�MP%4U}��vXe�f�v�����"��t������������-�{�"� �0��WV�\oom�N��Հp$�3� 6�xrG~h�p@`ع�u�DS�]�-済Ng�,We��p�x�Mպ ٠�Ǿ��:S4u��$���Vr@_�]1�(d�l�<+��8r}��:�� �67�d��u��ǍBa8dLL��71�5#���F����1US�G�8���3�ҵ�~8x<�w3�+"�i4�Mk�����3�}� .wsƃ����(6��;���IeA�[5��A���@�X',IW��f���!&���U�h��M�5Jvv�y���H�dN�*V��iz¢�T<}?�V`g a��(f@�02��17C �bwTKiH��\ �TZ�l�n2�X d 9�rzG�ߝF%X���;%0�{* �e@k�ƺ2=�;�T�����Q�*3(�/�N *�jŚ�� L�*3�u{�٭�;w�[ )����ؠ��s��z�y$ �y�C��L�RCi,b��A� :��i��#��Wq_���+�H^)�������� wZ���tI�p�`.��Gm��e�����s�~��ۜ�%jz�mӉNFf�#뭮l]Y�� &��v[��ت]Ӟԗ�.k8��W�r�5�0� �{ZJ^� �'�M�V�&�,1�Uj0��Ж�L �ؖuM$n� '�i�5���s�� �+�:��6�e�Ua^!�E'���fO�g6��BZ��o�F��}i^��La�,��V춀V +>gs��X��:1�����4`�����IҰ0h����4 ����[�j-q���dXUZ$��7p��j�������-�@K�3���V��I;!Z�䎱������"6e]72�}t z��(w�O����F��Jߢ�xF��hgt{sO��#����ջ�aR�B=H����5�Y�n䚁�d�����̱=ί�!�V�~�� ^[j/��4^��g�,�M �aȋ���VA�a�l:��.����Q'? �V+��e M��i��"���j{D �X������H[�: ,Wτѿ ��c�C�N��d"��F���6�H����W[�(�ZV��AF���R�0�F���ŕf�[�~�u9,�ЗQ�B$��J� .�4�5Չ����)e������ �H`*1V��E�{�]D��f����T�l���2?���E&CSA��jp/:ET��u�{QI�T�g����u��cy���_��p��`���:��r�.�� �����"�2/�7ސEN���܏�V�T:��g�x��kjgw��a�M����� K��e�r��yDf��+"�����q�������oi�㠫iOk����-�_�hVy����2nۻ����i�ۭ���( ΒXg@7��Q��[ �� T ��R��h�w��]���:�����ˋ�+�n��~+�e �sZ#/�v�9�M�"䅤* Q��D�aVz!���iU���ΓWeΝb�2��9���E��&ꉤ��ќ�-�y�d� �% .�**S���a�p��u.���V�澛����(xX�*�U�J&�Q�7�u��_�Lv��ħ���x~�G�}|:���@d}lz����^<ǧ�&�=_~��9����-�SH�^��ُw+�-*4۟�k�<��G[^�R^��ۧ��h a,�.K���ӈ�aĜ�4�%/.�``�ˉ�H��\r��SrrԮ��#���o��*�9�`v�[2Yj?����g��_��խc0���%�����`-!ևG����ca�l5�JV�� �Z�.��eR��w�UL���\�)�R��wb,�ԓ�J6�� ܛ��1�-@Q�l�󻵵V�AT� ʷ��2��m>�ؠ3�(�[��u�@7��;��y�-^���f��sv��d ҭ� H������9��T�]���jK�?�P6�s7���8鯓���_#��D`�w�?��,L�\�LA�[�� ���C������5�D""��� K!�k�H)n|�bխϙ�ysK��D�O@&0�K�#�g*x���9��r��>O�/Oи���J� ���ު�T�1��[�XF��<�S�>A�|�%J�_�� ��s��-\�A�E(�J�gW�$\ˆ�_�������s�{�:�%7��kU�j��+X��.�ƹ��i���Ҍ~�� ۉO��X}ߋ]��������dXj0 �D�.������I ů/��;�"��� 6�|���y�Yy�?1^¿�X �r�?�2���֋_f}����u*4k"���f��9 ����MQx�27�e�����4��9�U�W�^9��d� 7v���sWv����4U���wɘ�_ Cn�ٚ���bv6濰u�K"q�ƟQt���3�6�mj�ĕ ��X�O=s�R[&�v&�+ ��kϒ��p(��<���ً^����ٜ_�h� ��7��� e�lb4-c���T#ؚ�:•���%�|���x�N���ˤ��E c���.� �Ҵ9��%��q�`��Pɔ���PL�?��aUZ���&_*UF�LvM�EW�{��B�ܠ�M�OS��7lh�v���*g���xy��a� �C���j�]���Ua,��2 G�� ���d���[�T9˲�0`.tT��ݹn��#E!���?n��'E��%�:�u���o�چ���bwr�+����d��D`A���?̆ �rl��I:��v6Y�gE��e�۔�WH*#{� �Q�L��J���Jr��8M�Y�'V C��!<�wϱ'ީ'�Ȃq���%~��w�H{�l��w?�B�S���A�"��A���b�\�&��r��� �_P&oS :88͘�'��A^����C�AOE�I=�����nGc� sQ�_ \�J. D�Ѕ�K�U��R���H�J�~X�3��<��@�"G���� �_\\�I6S4[ajV�jV��C׺F����-�����}>!����l� $DH����aD�˶GW ��=~�5W�b�K�\}�lQr��&�qx�rYt5�lu$�[o��c�8�x>����:��&f�u�S�9+�x���*���oDX�H��WB��R�2!W�K��IR2@�f{�����s~��7�]�h�iA|��0l�%�|��-S���߶8� ��M���ګ f�E; ���_nf�v9����f�M1R���现5Ј�xI{`^�+��ޞ������Y�0�Tσ�{3�yx�[��h�㷟�O��s���߿�ٝh�ϣ�W�_�헃w?�}{y؛_�߻?����a��y����+�{yi�=�{��ӟ_�_�_6�������?��Ni�zz�&����SWs~�N&m�]�o�r���o����o��/���r<��y�����/џ��??��G�>�����^��>e�P�\�&�"�5������l݅d���A���`.��;���z����c�}k�;����ʎ |" Ţ�^T�OiKc��¸�'L2���@��vO+`��V��l�@� �r�zN%��:�:�g�WľYw����!:�(��0K�YMi� 5Y���^�Ќ��m$�9��h]����F���=�h�n#��d:Đb�}]�=�����+J��_G�^����"���=�1 ׮�_9�Z�}؊�n&XHqH�\�a4uEtk ���[c�89����i�.xl^��?�Z�o ��a>1n${��1!���8c �D���/��b�+�Nm���"� %.n[YS�Q���2��^Ϻ��v6l�X��y�6]�ZO�F�'����Bv6��OqO�����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 �#׉��<��Χ� ��|6�L�%IW��C��W��5������/�w�)�[�07��v��\�T/f���[�;eS�1(�Ľl�gF��fZ6h�W0n��WJ�[�Z��>����h:�4����Ci3�GFW�[^�_��Ş���w��y�#���cp ��#��$��h��\;�*�Z��ɳ� -�=V�%��gc#�6�|�c��aK{��yN��|+���|M�r���(���k}��� ��$?���=� ��:����| s����l+b�(=¦O�|�;{��YO"b�� �ٙ���6����#!J5�R����}t,��x��آ�X^����^�oQ�DŽaʼnM.9ֹ�F����m�J���[��T��TZ��SF}{��,�j۽Θv���[*�>1����Rbu}��1H+5J2ih���j�k #>�}weA�DZfSm۸R�,�ǃ��/������q�Eq�dNH��� �h�JtAϥ�E�%�����VZ2����VCH5tUo��ch+_�1�R3P��uy��z= 7��3ߞ����j�'���l���;��� _��&�c[���;||="b��:}4+�*f�;������Ɔ��=\\��BPp�<-�nW�+z�84��=X�MN=vj�NS d⻍b�"6'�t�N~2��;p9�[����s����.& �X��]�)`7�x೼��z��Ѓ��xtM�{����_��_��1W)���;W�����V�q�FF�3ט6��1����T�����|3+����/(�'z���:��-���th� ��E2 �C�Rp�-�����Ɉ� ��ʈ?���np ����-�O',=wNqG�H�,/�}�O�OP! J�� ���E��Bࠔ=�N�q0�a��9UKb�r�j�.��)�п��ԓy�RoO�R��60KP� �Ur�г F��ȯ/���񟄳���-��(�ͳ��� �ZAEĽ��i���7� �@�H�Kdb�TI$�`&v�xy!�x����A�&UD�6PX�]Sb>\���~�#@WɃ�B��ea��� ���*+���+��f6N���f�ƶ��d�/^G�pH~�4�F*?��c��l��36U�������|~�n;�5���%"M��8.��J.���$qJ\��Y���o�M�:S�G��f��w #��%��Se'�����m4�#$�7��%��%����q_��f�+a�l�%��y-lEW�q�P����L�Tr��p*0�] D�Ó����ł���ɐ��#��q MrS�a�$��H��Z�É3cϻ��$0 g���m}�7��8��Le�Z| Z2[%V�I~s��r��򾰾�N�:�X6���%��ai͜������v�̪}K�lB��j^C��ǧPC=�af�Ѯ S#�&��]�NKv~}~��B����߇��ǧ������-|��d���������=y�O�7��?�'����_�O�?����f�zq����<�����w��������h_;M��k݃q�j��O�O�/�/?M&��0�OfA8��k��]B�86�)� !�f}J�@Sr��n8L����b��.Iv2�{n�=R˷ِτa�%�����&0 뿥л��鰭@#����D�������%����̆�2:��R�I���9�ы�h�@8W�ܿ��^�$��Γ� ������uuw���5�DؔU�ʍ�lo��~��.�U�x�*��}��E�xo݁;m�#I��q�a����'zG�=�-n��o!z�{ꍢ`7y �� HW�(ͮ�t{��(��������K`��»R� kd��Tc{��� �����A���۸y�Љ�9��3y��g��.��ms&�'=�L]7o!��ܽb���ygt9·>)S.�����`a >���U�]�E��|������J'bJ!Cv�c�a&��3��p r�9��=��/SXЭ��g��1A�pc8)]_���׊�m�j�cE�p��K����)�7�S¤�fh�R��l_u�X-p �^��![-��6�k��P8qW!�{�G]6 �_#Ȓ%��ݳ� *��_8E@M܇�]Ҟx����&Z��K���Yo2C��D�b;c�t����:{}&Q(�-����t�@��RN[ Fs0ĵ蔅C�!1~���τ�y練p +X������2�M���l䉆��MaE�"EV��r�6lf�)����U)=32�[\��`��ryw����f�/!�����n�y������5]���TM�lR���g��#�#>67m�r�M�����'/C0� ?��ʗa����%ٕ0{����DKK�Q]�xl}�?!�ZFz�([�`���uvJ����}�ʹF�� R�ߕ�}��\�������n׉��[8��n�9f���5���\�1�R� -����G�h��<ci��o�<���gg)|`�#z���I�r��x�, ÑK�فK2 09Uev��ϔ�Բ�? Zg��� �%/C��hk�Ӌ�>ݐ��Ma��p5�ӛA�L������k�I�k�o��ld�&��J#������?������ ���? ��V\F��6�����׺�l��qS��ި;ꏤvB��S��b��/�X��<.�7p��rl[Ƹ�kT�����[��L���(�#AjɭT<p�I�M<�m������bpd�$�.���'�c����ʳ�x���LV��3d�B��U+�`?�yoR�c��L�h�� �;{���|p\���xk/Io��4�-�R�W�bE��,'̈����"ۏc���I�Sa����/{��8��{?��F���!�nn���CS|�*!�tΟ�w��>~?�w���� q��7"n�]J#�.���C�hIV���nO�F$���HT!�{QMwU��r�I��DoB�ЖK���xIN��θV�Ǹ����8�5^� �\#;ym���J���ƒ(F�{>����I��$IЍ^�����mf����O�>퐛G�Y�^����Wp��^�#a7y����4?eu�C��9ࣅ�\��ʦ��ҀFB�!� �O/�X��s�dI�T;������ `���%�����ʚ벻 �B�ï�R/��� �@ߒg�>���۲�͐�B�� ��Z�����ޙ���#�,E_�� c���HM�b�'#�7��Π��:��|�����K,) ?Ĵ�@� �?l�3ʆ�A��w{�V�+��qq�hF1�$:�J2��u���LKn�,�v�/f��/��]�ڗ��ҫ�7�5Wx�*dh/�_�8x�3Q�,)ƚ��ټ<�y��Ăq��?6�3�T����d4[��H�vtH�H��#�zg�ǐ�\��4 ɍCH��b