/** * 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�Le˒�\l˱�dg�h��A@]����?�Ӽ�����)�K���q%H���3g�(�tW׭����x�������w/�,�;{���q w:��+�K�F ��= �+�����^]�mW�Q{:���y���9����:I�(��a��9�p'vF~@��UD�pӛ7/|��܈�Q�wS� �-9�"ÑMÜѦ�7?�M��x��]�s(#I��~�<�idsf!�F���K�/�f��s:��mz�{A$Ar$]�V4Y��6��^�v���i8t�q4��p��C#�%/ � �2�����i@� �����ɡ��wo�E�NBzgn\��ܘR��� #��$��*{h����'q�E�I��� <�����5�m@��n�&mSF�!i���_���$UdXe��Xn��Lhd�vx��4��*SϛB�v�u�8LKJ����Ht僞 �wlӈl�ma���܁,T�H:BS /�Ȼ�1���"0g�i`���v�KJ-��M�)��x�9�_�)��(��Z�Z�,n����5ǂ� ��Q�Ø�ܖh���z.�|Eœ&�B������s#� �oɳG�O�?�o���ky�مO��g��F@f����FHOG n?6?6C�B���&k��G���~l���ZGQ���fO����RC���Sx ϧw�6���#�'|���4���'��b9���������B��C��0�Pg�N��s��JOѥ��]P�#r2�C2�J�/:'yJ]j��d�h�5��֯ύ�x��Aw�tb�h�: �X^4�>��F�6"{O���\zAq]97�=���7�! C@sy�M���G��5~:>z��������7�s��nn�~ h kT1A��=5���P�n�`/ �%�W��!�vN�Zk���].ry ����qU��x�:ލ*� �`T�O.��P��w-�D #��%� �_�L:��ѧ�z��E����F�� %Mc* EAD#}\X�� �'���ń��� ]U-��5z �3�p ڻk��|��|4����=`�Z�h��N}h+� �C���Iܒ�z�h��A�tKj\_@[y��ˀ��x�j�H��7�Q�P�9( z.�><_j FG#�����C`��D7I��/ �ʹ�����~E5�AA#H �S���q,q/���n���9�*�D���Ԇ�`��@�@]�`f;4��25� ���rk����l�v�}m(5���"�*>5\E��pt��|4�2��F���҄��%D�5(�~�bN�bX֋s��F�CԤã7<8~ q>� ���ދ�j���k Y��厒����#��}� =�4���ٓ��?�[�F��@C���0"��$�诤�y�������� h�P+�N���J65�9�>B��c�4$�ye+�%y��Rt���ӧ�KX��%�A?��XO�-�^�E��k�w%�Y�[�'A‡B/�� L�ϼ|R>{�[ ��PI�r$Y�ԸF�K�� 6o䪨��R �k� ���y+��?m��mA���9�i��a�推��A�[��L"�6 ���D3����k����� ���_�6���nT���i�|�7�G`�h�e%��[�1�/���ߣ 2 ��;@o|5z��[���� �K��g՛%���HI3�r����Z�(�k��$,���?��+����ó��>��;<} n�B<�N���$Pu� �W��G���:�zc�P��7��ik�3���v�0?�Q���x�D2g0��dPƜ�fƣ��fkX�Eɧ@�-E��í�F�9�lc�:���c.cp�a�}-g��eo{{ 硠H8�� k�'��[[���q5$ ydϱ� 7څܱX4y.g]���u�f��.��y!��es#��DU��R6(*��l8��dUYƁ�7 <�\�ЗbW 4r7��L��%���";�80���M"+b�4A�Q3�P�c�`c�M��t�糸�V�� �Q%}��"�=;C-]����Ǔ�d7U�,R[z��2w� Ɂaًp8��r7c]]�V�!�������X�&D���0LP���W��H��� ښ��+�5]��}H@ZJ��� E햀�8\�]F�T����:a\m�Oы���(�A��e�:jI�����7�S�eeWR�q5Z��/.�b��H�K�7�< m3�A�:����bFZS��� ��'��_O ��#e0����0cϺ",��(�vo���K� ��e#d��9��) � �=�&�m�>�_'��e�ǔ|�!Ä��b���ā����I�jiM���ʋ�� ��-��)zg���qYef�|���[1"&�FP[=ʩg'8�bPS]�X f6������HI�$�%����"��WyhZ oi��i�H�N$X�2 őFE�b+u�1�b�U���60���J~7E[(�/�7Bʋ�`�m�8�u�4 ���>D*�����k�{5_r �{��P���y@•�ѽh��Gݿ*7�\�6�M���E����O�6������˃��; ������֊�������@�~�������к��sUm��jj��;�R�Gݙ�J�t˂A:�����z` �ʋU�d �^,U!P�=�Z]���P�쫲��^ �2�}M�~vv;��>�l��^|�b,��� �"��n%�x���Ũ�� ..<��!�U~��%܋L���F~��^t�Jh����#)��� ҉��t H ��zC�l��y�2��u�; d�J�]��e������e�_e^�o�!˜.珅�����46϶�$�ה�n��a��l�s��� ���e�j���Df9�."��'��v�F���{��o������O�����-_�pVya[S��2nۻ���iD!ۭ��%�1��XgH�:�q{�[ �� T��R��hҝ�&�]��?�[���ˋ�+�n��~+�e � Z#/�v���M�"䅤2 ax�T�aVz!����e�����k����!(�Zd��}N ��zEM�cIӽ��3[F�p�Aҏ� �T� c.��|�f�\,1Y�b�}7U!��!���(�ë�U��G5��9��u�)nW%o�BJ�r�~��\�Q���T\C�Il?���*�����>ŌF#c�vY*�.��#f���-yq �;{b�vtE"�@� ;��� �v���L��ַ����.��X. Ú�ᎅ%�UI;^�..P��z�.��L�[/c |-��ࢢ�+m;ۉ��BO�.ؘ�7\po�f�p�E�Ud���V��/���g��#d\�y�||�A f�Q�Ы�� � n.�#����,z[����@���@;D��$[���lyA�� �)H;�뷔�2x�,:1N��q�_'e)��FP���,(�XAY�:6v�<���t~-,ۃ�=���+=�XDlo��B4�׊�P���ź[�3�x�K�Eˏ@殀0�I�#�g�x���9��2��>O�/OѸ� � ���޺�T�1��[�XF��"�S�>A�|&% �_�� ��s��-]�A�E(� 짷��\ˆ�_�������s��:�W���U�j�=,X��.����i����[z�� ˎN��X~񋕻�������d���?�D�n��ؽ�1�H ů���;�V�䚘X �`̷ɞ�_Έ��q��%�[�2�*�������`����׉ܬ������g2fnD#f=y�1��L�u~��NӜ�W�_Ez>��8L���.��%�/�\�%nH��R����%��~) �qX��k8g0j����������. �YZ���@�P�y� �v�4��X�O]c�P�A��L�Zdv1�-��Wk��e��ۇ� �h&{ ��~׮]/�Av|���$�KR덇D�L�d����ң�|����77~}1\h-8�� �T��'����6�����W]�^IݶZY��*�2��) �4�]Ot��ܕ���A���S����9�)�����KX�ᘂ���$��tO��C����}F�����Ǖ�LrM�7 =�x�R�%���1�E�QsbX�k��� �31+��<�ݾ�Vp�Sf���$iup�#� ah@�tV��Q�`��۱p��vLpp3�M�6H9�k�Cov #�+��*�������x(�㤅� �x ���U6���#� 񡍰������p2r��D��J��� �PF)1�&��2����l}b �����,b�~x�Z���`�-���̌�tNs�� q�- �D~Z���x˦ݰ����c�+��C #N6��亄���q��oa��cc�<蟯�ә�aQI��ob�IJ���h Z�*ˍ�(F�5%u��/qË��d,@gs��+�I0��@�⫐=2�c|��s�K:c�?*�b,��UQ������ò���N�@T��N�lE�EW���Rߣ��-�OS�&�l��v���:g���xq��a�0�C���j�]����a,��" G�� ;��d+��[��9�4�0`.tX��ݙn��#Y&���?n��'Y��$�:�u���o�چ���b7s����U�xƒ�`A���?̆ ��-�q:���vY�gE��e���W�+#{� �q(�l�����s��8��i�;�u]�Y"<��7б'ީ��Єq��f'~��w�H{�,�����){>M"$ĉx`�0��e[�%P����k9��x�o�~�)��+����l�,���=�F�ݷ��Ҁ1q�N<��q�slLtb3i��ljҌ���]nj� �7",A$e�� ![D.i��+��� �$) }�����p��9����.b“Ӱ�h�����6�ϧC )&٫�ȯ����_ar�~i��΃���6���(4�\��r�J�{؊�m&X@qH,_xA8�}Yt�}ϊ�ݱX���ow۷ ���ͯ���{C�^��A���hN ��C,T�%#P��cŪ�v�A�-��P��敊��b�/�vu5�~�v�ݰ�b�B�Sڴr��@��� U���Bv77��pg�[]�߱ 9`e�4֎��""��D��O�v���G���`c���R�����!�۬a����I�p�KT ZZ�u�||$U�k�� ]�����aFz�bE�1�r%e���/�yٮ{�Uar/*������';47 �f�Tcb��%/B�_�;���#;��&0g���5l��]�\ [_ɏ��}h���o���)^`�4=ȗwf�t�L�g��ƫ������� 6�3�Ez�9 ����w��+��$�-�Y�N4u�������*t�)Z��9�#�+�M0G��Ef�fS*��D�8~�h��H4��|AS*�H��-Il2Z�1Ӡ�ʲ��<�r-��\Sc�ej�?0���H�M?����pX��kj�Sb��˱�&b�i�L �-Pfe�90��²}l '��O�`�ho�N��wa����'��G[���I�� Pa�� /������:�6��B��F�ĆP���>+vڬT��!�f�*�e*��yl ��5WV��9?�Ӳ�y�������MC���[��eG�4�P2o&��(�3"cϒ�d�Ȋ�;9��m�~�W�ۤ��l�B�����$Q�|���\�1�S<<�^�q�z�q� �) ??��y4��� �{��ܺ=�O E�( Uq����A0'�կ��&� s��Z�͕�BN��t�]��pl �2���P�a2h|o�N� �ܓ ,�?�(#2�ďcF�4��O�ٸ܃c��sL8]�� K��S���RJ�K{�&є�㗈���:�U�s�O$8\e��a�A�n��sFՒ�՜���hpr8�.� ��q�Pw�FR���1KP�1�ur�X4'F���W�v�E����[�~��nn��&�H ����-5'��"�i�ԇ�BEěȆg$@��21Cʋ$�^0��H���H�p���z� ^�J��l(,�V���2�����e�`���=rY��-u�$ɱ�J-��� 㹍��S�E������9����w8X?�C3���b������������pG����??����j�l�u�H4T����� '‡g)I�W�8}�v��IS*���T�;���~\+�g�='ʎO_s_�ق��K�oL�K;�-m�����M}W����?�o�Z�2��^����ᙖ�� ����ݒ@t�q<�H~�Q,5?��Ѫ�I?�E�$��Hj����X�`8���y79|�&����Mq��f� g� x�9�tƋoN��Ě5�n;�qx;CޗV�߉R��°�s#(lmb��3���~qK�ب��Y��ɞO �Bͫ�2�`�G�٩B��!�����.~7��nؿ>?z���j�������ً�����6��z�� �����|Ȟ���'Λ����?Op��ǧ����g�g��d�o~�N�s�������o�s���������$`�������������h��'� ��A�p���G�E�9�$�ܬ/�O��hJ��ʭ�I���x�>�%�gv�Gjz�0J7���ù�����|K/�wwp;bG�F�)���@OmOr ,M�75p��I� �ex>�#��'�x|��l"��V�OW@X�"����s�:Bx����A;OZ/���W���M�+�T�HaSZ=k��]�K;M3����Y���wh�1�uo��+��L�I��wGj�h]��l`��-Wd��̅�q�;���͟A�2$=�+�z���ۢ8�����n.��� �J�.̱��R���_JL8�P�_��� Yb �o��C;4����㾮i�d0lu�� o�35͸��O 犝d�_La����z�H�@�?�����d�|��V�F>i���<��n[r+��)� �����3�L�%ȱ��V��� Ln��l۟�=�m�- �4Y|a8ƹ���o��cE�p�������6�6�m¤{F`�yS�l�u�Xmp ���M�![/W��R�ȵ�>)��+��=�. �d��v����o�ϝ/����hO<{]kb�1-�����sz�7�!�G"�tF1����m8�fz6��.`�I��z�,�,#�(��$����� qM:ca�H�DH�����3!Y��-.���'+�p�8� vAr�@�->��:�ɭo�U�� P�ߠ��L0E~����*��F�r�k�C��_��.��Ͽb� =�%�_��]� 2�����_?���+���� ��k�$�x�p���F�����)���^���e�r�_X�"#��X�$�2f�[ ßpe��!��Mm�͢���$^�H���5{��N�����Ͽ���H<�A����ՓkR�����;!�� g=ح;��B���Pu�)<P�(C�?h���a�'�C_Y~�Y4 ��.��Y ����?����9�I-��pd��`���(&����2�d��Mj� 9�3�����j�B�歹�iy|�nH}�&7�������͡A���i�����������?6�=vt% ��l~\c���g}l~�����c2_:."�W�^foy�=j�������^��� ���z*����|����y,|�W��8��r9�L}���u�jc�oimq�V��Ux�ϡ ���*� 8���&��6�rگ���X9�01�����7�I�������$�?�� ����[��ի��E���7)���ׂ&�G��O ���J�х8�T���՗$� � �זt%��t�&�v�cf�GIArP��E�e�$7��{OD�����a��Ͻ_�Gc�^ qˈ@77ڋo��>O�`2���cv_��;N����U9K7��7ή��� ~��!b�8�Fjl�MC�e{K$*ཀ�&���Cmٓ8C�Ô�;%�hˡe�[�$'wp{R+�b�Z�WX����C�����ve%��c��,\�?�r\f��hn�$�F� �h�F�C����d(I�v�M���,� /�AF�k�Ox/��?��fl��?�����v�����k�Jq��Nr�@3&�d�'��c�Y�9 3�$M���a�z��p���������J�못"�B��/��/��� �@�ߒg�>���۴ύ��B�� ��Z����X����#RC ���ƨ!�葆jC��� q��� �;��Jj�v����R�+.��0��ʞq6����t�(va����j��`T�S���b�Fx���*���ס�63���3��鿘���:s��@�o}H������Lᥫ��uP��~E����D���k&�g�� 祆 � ���dd�dІ�w %����j��A"D��I�=;=���̲�IN@ �*���4� �d� \�nH/�8�o��GC���a���¥쏃o|��ݓ�|�2z �H<�&�M~Ⴀ�irr�X��� q*?���J�nN�g%���' �ߨ���'�E _68Ƌ��1��1c�qT G��򂌙9��e�92��������!�ôw��c����]�]�_߄JZ���>��]�#��2�V��q�5[l�h��g^@���y���l� ��\�k :}��n��%p�<�]�������<�����ɘ�������-�g�����(�-g\E�d+�_��`��k:������c�KMʑ��ƵE#\�����~c�CF��FGI�c�)*�d�J��b�vT��# �1*�!5�Br� ���,�̰.�^wh��ȋ�٘�Qܢ���� ��Tس&޻�[�����w�<��o��рk�΀�a��'�~k��O�B^S#p�"�!�N��!�b�0`|��+Y���Ă O.t[�/Ʉd��y�����gb�4�|���"hG��H�|=�� ����z#���Y�e�O��Pk uuY�o�ey��"-��Ԥ