/** * 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�W29���hH��L �h>kp�<���q���ޙ���33'T� k� 't�me�8Q�C��IA\s�q>Ʉ���$cZ�\3�&T���!hұ���i�%���OZU@�UVH���E�Ș��t���N�1��:�� Ta�DXg�ì�d�P��S��W�� ױ���FE�]�\�B� �#4�m���9��CkJ���s���Ԗ�7�1�7����6���6����BV׳�;K����Л����%%b�[R���@+�L��@P�+�4����e��l���i|K�=�pp����|�ؾp<ۿP�.:�?;�42�� ɵ42#z��@p�����N>6X��>B���c����۪�6?6��e��ؐd ��j�M�%:�� d��� ����K���Z�fĊ�/��Gtʎg�s�~�Xà@�Q^8���i8�]ՐnnvA����ԉ��q)��蜔 �hب�G�g�Q�٫_��!��H��I:�j�~�W,/^G�}� ��h@�ؙ��9 5�^�C@\W�MwN�Ƶ��nD���~jS�7�����O�Go����_��z��bM���MJ>� d�����V\�dM�w�{Qy/���.� �{�Z�\��r��Sp�Mc? ͫU'��)�n��Z��.���=x�O�CqS� i<=��ખ�+��~-2�p8 ?ğnꙂ牂� ��X�4v͉4��qn������c��?� M��w���i)بV���>xTDk���sS*gq$9��ӧ�ʜ������o���=��v�V�wK��R�9�R����^H�����]V�I�:�Ij#��I�?�GRE�Hd�o=��qR��(¡�����GC������_h���G�{l�}�4���1h�U �=���x ^�R�j �B���Q!� �bW��%Ku��h��A� [��/����P�eH���{5x���eX3U�{J�� �?�dS��h(u4�4 �������&m�������Q��?�Oøf�4�2=Ř��������jZCP� J�H��t���Sǵ�a�T��]�Ϝ�[�!� ^�;�c�k#I��x���U|�=U��hx��|<�2�"9{{qi� ~ Qu2e�OP,��QM�~qr�v�{��tx��ǯ!��A?��{QV 7�y- ����a��utȼ~���Z�g�$=�2g\���gp��0�hH��G��Դ��U�?�r�u�VO��j5ߩ�S[ɧ�:��'B�sSc�>�����,{��*�O��[��5�oh))T,��j|�!۾5G�_�� E�q�O��0��1=3���j� �)��q��?�A$k }_ębEQ2��l���y�|ZA�l`�T�>��am���Q�1�;�S>���0��1�F ��rKX����p �D3k��_Yqr���e;Q��W‘�G� +���]���M����b֥MMPwe���":��rX�\�13É� �F4U�.d��b�*��LL��Eh~���[�U})v�@��q�����0 P����/��B3���$��"�MT7 �Y��11 6f��8,׌p>��:��`TME������PKז�����x<����Ԧ��6�]nBJh��<��'�����.r��p���IeA�[5��A���@�X',IW��f���!&���U�h��M�5Jvv�y���H�dN�*V��iz¢�T<}?�V`�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���Df�."�����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�澛����(xj�*�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���%���C�`-!ևG����ca�l5�JV�� �Z�.��eR��w�UL���\�)�R��wb,�ԓ�J6�� ܛ��1�-@Q�l�󻵵V�AT� ʷ�B�2��m>��3�(�[��u�@7��;��y�-^���f��sv��d ҭ� H������9��T�]���jK�?�P6�s7���8鯓���_#��D`�w�?��,L�\�LA�[�� ���C�����ؕ�D""��� K!�k�H)n|�bխϙ�y�K��D�O@&0�K�#�g*x���9��r��>O�/Oи���J� ���ު�T�1��[�XF��<�S�>A�|�%J�_�� ��s��-\�A�E(�J�g��$\ˆ�_�������s�{�:�%W���U�j�=,X��.�ƹ��i����5�%�/l'>}�c��/v���LJЇ�a`��4���q�c�_�F�&5��L��|�[e�kb5�� 0�{�~�CV��O���o9�ī\��n�/|Z��[_�y���Z h𿟼|&`ff������f�N�ݓs���y �}Da�d�m��qu!�\�� H�)��4vIn�=u �D��rԜV9��o�L��v�Ov�o�U��T��&I�m��H�B1�UBepTX!��v,\�$����g��2����s%�`�0B���,� ��)k�� =������@�$[cӋ�9���Y�����KIs7'���q,�,���ȉ�#lbb[�b�3�)�֧�0�X� �"F�w�����,�Eԑ����.h.1Q!.�E!����T�o��v��2�x�u�Ca���{<�\W0P�>n��-��q��|A����v6���#,)���M-?mCY>�MD�Xf�1�����p�%ixI>����l.ޣ�`�2)��c��|�K�F��4y�`Igl�g@X��bT2�*�0��OruX������J��.�]Sdѕ��{�П&�h@, �)`*z��� M{�n��Z���}�/�1l$}�v2_-� ß7�*�e�P&A����c:#{܁l�b+��*�`Y��̅�*�þ;� ={�(��c���Ǎ�W��({�ģW'����3��o�5P���#U�f~�S�J��X�,:=���0�_���@8I�c\<���&���H�,|��� I`do[�|6���c�`WIVQSInU��`""K��Ċah8K����:��;�d`Y0N2���ot�Bi��'����%vU/ !/+�͓֧��^�@��bJ֖ =(PdY� h#2�[,@��ݤ�[n�}�0!� ��m�CA���=C7�kܡ�c�9��? �'������h wd.�"� ��V�%����~ 㱪UC*�"@RIQ ��t渙��p(�B�(cӢ#��R�� 5�f�fb+L�J^� W�b�Z�h��~��w�ZC���'$�q�ÙMR��)qb6�(t���j���/���Z�})������#J.� �=n�Z4��f#���Dx���4` @��'{��\��L��q�4gb�/DWZ��?���KI9�*C�Q*Z&� |��C�/~��������?~�^���7?����yt���돿�r�o/{����{�'��:����Ӄ�)�^OO��/�~�j���ɤm�ku����_�߽��}>���m����?^��?��>�%��a���������0���ի7çlQ�����d�B$��C����P�¹]����̽��3�7̅y'0��@O�v_t �o�sg�"?17W�1�OD�XT4�{��)mi,tZw1��I�?Sȕ��i <���m���S.�_ҩ�]�R��,���7�s}�“�h�:� �m$�O�RL��+"�V�?��E�u��H�k�T\ķ���0F���5�+_�"�[��� )�� ?��N��NbmA߳�xw,'Ǣ���:����K��gW�r㽡?�� ƍdOp4�!�g�!���%#P��c�֩�փ�[D�����+k z ��XF�M��Y�ö�Ά��:O�ҦkW� �����ZBvV��fB��)� �֗�w,CX�uk[H�F"~�΀�V����G���`��Z����C@�Y��� k�`ဗX/\h������T��-�3tՃ������5+��9+)?��x}q���ۧ�J�{�P�%�0�<٥�IH6�ȦS'�/y)�|�:є�'�)56�9��F��$�J�r`H��Jq|�އ��A�m��9� �����4���Ō�x�~�l�CeE���M��h�ެ@����j�]3�� C q+����]��A��h�~�C3��ڌ���&X ��"�D�)k��D�8~�h��H4��|AC��H��-Il2Z�1נ�ʲ��8��l��BSc�UjI>0���H�M?����p���kj�Sb&�+��&b�i�\ /,P�e�90��²}l '��O�`�io�Φ��wa�������Gۊ��J�� PٷM�Ƕx�3v >��t�V�5{rV*���8~�r��6B6� ��B����v��s�i�5�B7^�y�pǡ���,�&�;�x�释�4�G1���d�l'?qV�=����@oo�u�ْ.( Y��]��)`7 �೼�;{�����ztU�{����_��b�M2W)��W��{դ(,��R$��P�1m��3b�������0��m��WI 99�_�O��s�u0���[�AF�H�A�I2��C�Rp�.�� ��Ɉ� $�ʸ�����p���o4�O',=�Nq�H�,/�}��X�OP! J�� ��F?�B��=�N�q0�a��9UKb�s�j�.���п��ԓy�RoO�R��60KP� �Ur�� F��ȯ/��������-��(������ �ZAEĭ��i텊08� N�H�Kdb�TI$�`&v�xy!�x����A'U�6PX�]Sb>����~�#oWɃ�B��ea��� ���*+���+��f6N���f��v��d�@� ���� i �T~����;�+�B;glf����c'�ټ�W�@ȶ^�P�4AC�x�+�p"|x���)q���g n?|�6��L���[��i���:���o�N����2�/����;�v�X����}������ɳip�$�浰e]ǽBAg��3=S�~^��oH ��L�|8 ?�(���_�h�H���ޏch��B�#ɤF��:��N�{�M�%�I8�p��`l����&9��+�p+��֒�-��M�[���̐����w��1Dz�&1,�� K۝�����W��$6��`V�rrf�ƮP�z >z����hv��j�05o�����d���G�/��_M�}�y{|:}q:�����_O����/���ٓ����}����y�� �������_�lv�� ��ϓ�i?~�}7���?�-~�����d���=��֞�����"���d2S�d��zn�F��%ČcӚ��Bn֕��4%�q���4�.lF֞�d�3��#�|���L�[�]��,mnJ����[z���[� 4"]�Lz��JXh`Yr���;�N�l�,�� ;��4�񉡱y~��8[Q���;��i��K���GR�i���)\叧�R:ߵ�_Ę�����?�T�[����y�w�޳Q�Q��V]�Q�[�ǽ��( v��` �ʀt����J��j��,<��?����.�+5��F�J5�g��)1�A���5d� о�[��Ț��D���{������6g�|�-$��u��?��+v�a>�GqF�#|�2������ ���Ӊ[[��X�Q��W���e�m�t~�2dg>�f��8s � Ǟ�����s0��ߪ������� �1�����q��z*��E�9yáV.���E�p �j䛡�gPmj�]��b=G0\�8�`��Zc��&rm�w ��*�xO��ˆ��kY��]�׶�A%�� g�����K��^՚��_B�#��sɔ:�M&��� �SL�cg���Xgg0�$ %#�E�����bA�i��hF���0`(q"$�O�^���<��fNa �sb�y�T�� ��`�m?��:�)�y���� P�޴��L0E~����*�gF�r�K����_.�.��?�b� =�%�_��]� B�o������<]���TM�li��*�'��#�#>67m�roN�����'/C0� ?��ʗa����%�52{����DKK�Q]�xl}�?!�jFz)[�`��+yvJW���}�ʹF�� R�ߢ�}��\�������n�؍]8��n�9f����5���\�1�R� -����G�h��<ci��o�<���gg)|`�#z����N�r��xN�, ÑK���L2 09Uev7�O��ԲkB Zg��� �%/C��hk�Ӌ�>ݐ��Ma��p��қA�L�����k�I�k�o��ld�*��J#������?������ ����? ��r\F��6�����׺�l��qS��ި;ꏤv_B�U��b��/�X�B=.�7p��rl[Ƹ�kT�����[�ޭL���(�#Aj�MV<p�I�M<�m������bpd�$�.�B��.'�C����ʓ�x'��LV��g�B��X+o�`?�ioR��� Mo�h�� �;����|p\��Mx�/I�$��4�-�R�W�bE��,'̈���"ۏc���Io_aw���/���8��{?��F���!�nn���ZS|�*!�tΟ�w��?�w�����sn��7"n�]J#�.���C�hIV����P�F$���HT!�{QMwU��r�I��DoB�ЖK���xIN��θV�Ǹ����8�5^� �\#;ym���J/�ƒ(F�{>����I��$IЍ^������f���iQ�>퐛G�Y�^����Wp��^�#a7y����4?�u�C��9ࣅ�\�₧��FB�!� �O/�X��s�dI�T;ׂ���� `���%�����ʚ��#�:��/�R/��B �@ߒg�>�����͐�B�� ��Z�����ޙ���#�,E_�� c�O�HM�b�'#�7��Π��:��|������/) ?Ĵ�@� �?l�3ʆ�A��w{�V�+��qq�hF1�>:�J2�����LKn�,�w�/f��/��]ۗ�� ��7�S5Wx��dh/�_�8x�3Q�,)ƚ��ټ<�y��Ăq��?6�3�T����d4[��H�vtH�H��#�zg�ǐ�\��4 ɍCH��b��$��\��q �y��~�"�]� ����v:��.5�@Z���k�ƸxM��M��2c���u�����cTT��!��u��x :�t�Ǩ�o�Ը� ��~s�03ú�{ݫ�Tb?�fcA�Gq�>�G[�'L2Wa�x��g�ޟ�HQ��~GCv� :��)6����IN?9@�*yM��#3��$?�:�P�}ր�Yd �i9��m T ��lw _�����•�/� .�$pY�f�5HEЌ q�{ܻ�m���F��[�ۊf(z��큁���f[Q���i���