/** * 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_����������d�݃�}�"�� { ���SӨi��}�\z���U��:�;�:��pu���f�&��]��BF!��Q�S��.5���()��":�W��qm���Eԋj�;:�M�j�G��Z�5��`ү}f5����]���L!&�)� � B�42�52CF��r~�B�UH-���1�)��~)D��)SǎF=�^:U�K�8�9@�Y�K{�@9w:�lsF~�C6r�Ĩ��Q߯��,������I���+��C�����k�C���R�vV����4'���S����%�*�V&�� �xQ�s,�:��iZpE�&�J*��� ��۱=�� hd�vD���j�ȪC�B��Z��%Ӆ�̈*$��Y3\�2#��j!c�]�]�B����|�k���T?9MBkD�����K^Pj+���k�_�ؑ?C��M9�d����e�yg ͨ�4�g�ǭNn�P�� ���Y��{ �������"z�>��f� jߒ�G���?�ok�Sdz�i�bб��9�Q�xCFz�Z雌���ґ�}�}����Ï5�R�G�Ɛ~���kz��U�km�m|�)����� �� �����@O��C�R�s�@K���r��k�#:Wdz܉�t?3��1�PK�����K�Z�v�Pnn���G�l�02p\J�]�:� ���h0�,4ՒS��חfH� ��n�N�-_G��E�k6 ���Q��D���q�)ytJ�q�zi�z2(�o��2hN#?�U���—��O�'o� ����JQ�|z�FH��&!���F����VT�*Z�M�*�}�*��2$���Tk)p�� ���f��a����'�S��\u��r%�����y�<7�nH�I葨J�f��^A}�k�I{�^�!�tSN<�̦��-�(e��C�# "���ޭ[�9�?NT|��f�g�l�e)X?V����y�Gk��s]��H2�O�sր�~C�O���<��f�÷�$i$�3�s)�BJs!�ގH��� ��u���F0��h��������*�H zZ냸ֱQ�=58�)�z��v>_h�����{j�}��Qwa�w�*���d0/N�w� �1L�rǩB28��.�N��KV����a��C1l�r=���B�!�}���H�)W�^ɬ"�3P�U�}��R1����������!xP�$��>�p4�>������� � �TO� DZ����ݨ�B� ���?�*N��*�Գ�F�kCú)R���; �[�!� �g;�S�k�Ra��EV�U|�xU�Y�he@E�����E��D�U(�~�bNNմ�� �+�E�C����G"�}�:� ���ދ�j��kY$��������=����Ks=�0���9����?�[Uz��@C�7�i�I�&�诠���@|����hPW��Z9��lj�s�}��uoJ��GА�祭���5�b��w��>�i}'�w�X� �b9U��,z � �����?�]n��� �zaV�L20� ����w�X ��JR�D�#����5��Y�n�y#�PE�@�RX�\�`�-�-ZAl�i����L�� [%�Ge�"�����݂�f�A%V�T�;Dv5Q/�(�W�x��Gh9mpЅ�(|d�`5mt��ԧOs�+�9?#D�-*�6�b�i��r���e �Q��z�Y�o!>���7�/ٶ��nԚ�"Y�h�����Q��EIxh���櫙���ó��ܡU9vx���T>�N���$Pe� �W*��G��� :�re�P��7���k�s���v����(�v�c�v�I"Y#��*(cLU��x �٬ /�jY�b�� (���^�w�pk��QNjLm���N��/™K��k�`_+��r�����IP��a�1�|�����֖���5g"��G�+���.���Цa��Xs1�Je#�]�-筈N�s9f��8,�d8K%�v Yc0ZMD�O���..PKז��a��`0覊Wejݨ��VW����3a�=� ����Z�"7�Ma��ggDb\YP�V��j�I|G |,��W��z���S���U�h��M�5Jvq!x���H�dF�"V��jzȣ�T� }?�VU`'a���& ��U9Ue�O̐B�讂j��i��+��j�C��-@+� $g�BNo�{�w���l;d�������U�(��y��bkfz8q�H������5Ϡ���T�Պ5[�.U0f�k��f��ҹtl5��W[��Ν@��'L+򆂇��2��ʘJc���zW���\+���V����8 P��y�*%V6r�Km}`���Z{u��Nt0 A��M���8Dg=�n�R�93LJ��zӦ�J8웥VEo�+�Ѯ�e�=�Ē�lVvuHl���iO�KI�k8��U�r�%�0� �w���V1�݊^�n�^`���Z��i͊���]���"H���Mb5� )�CkW-�wq�2��0gHv� ����[���6���4*�^�6��Hsj�c���p2^I��Z ���������+#��PA#NF a�8 ������$ 4v+�[�j- ���dxUZ $he�7p��j�������-�@Ko5S���F��I3&Z�*-cm�'��"�+�n�"���S����r ��.���Hs_�[�o��68���ݓ�gc}��e���0����$1���fp�эL3�뼲u�V3;�'��U4*�Uc/�߀��-5��^�A�3�@b�:��K�0���gh���z/D6�U@W1X�Xc�iA� ��Äj���2�:i�W�4D_����jsD ��� � �j}w�.�4�Z�����0�7�@u�� ��Z��Uc���6�H�������n,+ �a�R.*��2���*�|q����G��\I�4�e�ɫ���7�鈆�Tu� �R.�*_���#E0�б�0}ߞ�9,��(ߺ7����NCĂ�]>BV!��[����p�9 � �� ����u2�^�yL9��2LX�,9�A8{�XOFVK+�d�V\gWU�x�h1-�j47*�!���L&F."��#bri��壜rv�A��j�D7_�3�����HIk�I� p%Q㚸�\š�zx ��NCD�w"��Q�i��}��R]o�y��2�H�e�ERh)����+���7B*�`m~~��za�<�}����C�v�q�����P���܇ڽ��^�݋�|���r�uo��ğ�_�����I���ļ�D�yy�w����; _���뚾������@�~�����aw�u�u���g���6�Uwe}ugK}�- �V���t�^�X� ����:�m��V���&���U�Ň�d�}��ݾ&q?;�QZ�Tq/> 1�� �"��n)�x���ŨV� ..<��!�e~��%܋L���F~��^t� h����#)��� ҉��t H����"~����E��� w@��໺3ƫ"���Y�����ya��,r:q��'~ķ�&��� <�Ɠl_����m�M6r,�c����6����� rGD��̱��z���R?lh�㨭iOk����-�_6��:��x�m{���&@����T5F#�q�t��z��o�u �2{���P w Z����� l�R�i���Z��L��r<�&����_��9�5�b|��oB�!/$a`Q�{C��[�TeKӊ ��؝WY�ٹt(�^ dZ�sI% ��zIM�cIӽ��3[F�p�A�+87(�LIƚ� ����\<1Y��ͽ��P�t��x��l��_U�3��i���Y!;�t�Sr��<�Ó�>>�\͆Y������ċ&�tՄ����Խ��]��� ) �U�~�]�Ц��t*���$�Qny�Kyizf�bF���P�<�O�È��}K�_ ���8��H��\2u�9����<�(�����5n7�%���#���|֬��jX�::#\Xܺ<* �b}x����㎅��H#^�_��Z� �]&E�z�\��Z0�Ś/��l'�S�z�Ɯ�ibÅ�f|f w PT!_E�nm���1�*�A��!������� 0�r~ �v������#'�?ϲ��� <� Uzɏ�C�L�+�Z]�d�k�������s�~�ڨ�=�P6�7J��8鯓���_#��0�; ��VP�0��.SDP��n�hb;>��,rƾǯ��$b��e(?`X ��_+FBq�#�nE x�t��X�p�3�-?v������������g�d0��u�4�gRb�O�x���oc GpA�|J��9���Ab.aD'�ǨmpQ�����dɅ*��<�Zt� ���iP�4j8��j�F�=G���D��~,����]����x�P2 �j0 �D������>�I �//��;�"�� ��|k���I��xy�?1^���X �y�/��Q|� d�/��_�J$��t��AB1[1�ñ����%�xr3V�"qMm`^"�*|�� �ơН�s�-z�a��-y ��z�hW�]2������C4Pӽ��Y�/���>vf]��yYi2v��z�F��B��e�"�� �S��Ԯ|��#�_�u�Ç��R,���+>%{QNjF�?PѤJ�w�r��d�אQ;I��$�\yHd�4Mfx*.+<>*�C[[�WӃ���D�PK3xJQ�^�k}3� [*���K���@�����A�6��) �� �=_v��ܫ1�x� Qçd��<��V��R4� .`I`;} Ύ�Q$!,�t2��6����%���m�!^]�$�dq��c�g%�.�̢'���(�X�Z�*睑 �mB�ə�v�Iw�f���*���DH���1^�BC"���PUAH�y �.�ä n��� )���K�Q�S΀jh�@r}3a��P��A���gk| 1;Ԓ�C��=<�\���ȭ�t�C6K��n�9LE)1�&&��"�[��|b �����,b�~x��Ƹ�`�-���̌�tNs��� q�M �d}Z���\˦����`ǫ��C �J>��亀��q���܌���&}u���?_o��{u<���y^���'m(��S� �l�,7���֔���� /��5?c�w�(�|�c�� dl���&##�77A�`I|�g@X��S?ư��!���.�؊0���y:�;nI0�cr �Vޙ!��?(r�eIXi�BhV��ݙnh����Ǐɛ���N^⓪dO^��<]LO���ٯ��!,�Ǧ���r�d%<��$ ,:=��m���c�8؍��X���b?+Sd-KߦƽB\��V8��:rl�*��k*�-j�4L$B�)_�H5 g���2ǟD�l��$��@�F�o!Q�m�2VǓ�%�4��X�L�HZ���D�!��)i[�� G�g ����Fl�i�?tSn�Wv�fB�̓����Ld� � �Lp�#�Ps�S�?�W!o���niw dΫ"� D�V�$����~ 㱢�Cɣ"@JIY ��t�Up�'�sԁiѾ�)P�t:���\�\l��YͪYjV ]k����n��=���mۗC�8�ጇ�@R��81 ��l�?[�e�˫��s_����� ��J�B��16�}���~���Ҁ1q�2��sLtc3�ɺ��Ќ����\m����oDZ�L��B��Z�2!W⋝IJ<@�f{���t�3q��7�]D�iA|��0|��'dw��5LM�|��/�`7�d�^L0�.������r=%���n�mx6�HI�`4?w���2��9��P�]������E}�u�?�������W��ׁ�������ΆM�m�o�r���o���o�{_^���`0�y�������a��������ÿ�^������z�n�� Q��y�N@I v=oݹd��!ވm0zd�@Oy =��}�)�1/�!����\a�>��Q�o�ǧ����ia�Łc&��LP WjsW�a�V��l�@��2�"N5��:�:���WľYw���&!:@W�&⬦r�������Em/ gh�C ��6����� [W�C�'�l�Z�*��H41�1�:����Q܎���y&��#�n����"��佄1 ׮�_�Z�~؊lo&XHqH����NbmA���ɯ���k�h5n<2�|���ƻA�~��A��� B ��C,�+� (F�yˋ�Sۍu��nC��T��H#b���ۦ׳�m�� �-�)t�8�M׮�3��wq���l=���̈́č�#���/�{,C�x�ukSH�F"~�.��FcwM O&!���v9[��{Z��n�����&�‘(�^�P�����#�_;������f��֬(1�X������9/��n����܋��8>�� � �]����3�|�1�q�{�'L &}�a#2?��O�� ��d��L�%qW��x�`�{��Օ��h�$�=b:��K���/L��Q<�7��+�����H�� �p����y �4�V(w��+��ܢ�j��8�����4Z���hХ�6��� A��ҟa`9rb�1K0���6�B����6�D� ��ה"�T��R䦡3ͥ�,o8��#φ��5$�X����� w��`=+�r�������o{����A����R�����N�Ī�#i|��=o����}|���|���>%��d� o]�[�1s�"�9��Cvq��%����� B��x�\�yA��W����b����S�`�D,�A؅��pDb���@����Ʋ�K!Ʀ�d�R�bMxs����N�����Y�p|��K�����%�c� xSU>vɔ���� t@Ð���:���y�H�CW��#<#��L�� `�*����nPj����F'���Ꮷ�U��\����㤲�-8 +���B ���G��ڃλ��j�z�o���=������� *�A�p�z챂;&DQ�JJ�&y9۪�%Vӫz-�����jD\jl���������h��y��oO\ZKJ��f ��q�PA�O�<�o�m���4 /r���b.6��+�p�����@,d����դ-�Z�4����7"-����� <����`���z�=~\�N#�|XP�C2���ኹ�y�*d�.@�3[�ea�{�4��YM<6�.a7��Ӽ�˿�D�m�p8v)\����(�y-Wͣ]�P�&݋8K!Dv�G�H�p�R9��ڨ�������_7��%ub���)BD)�B� ���i�8+�A<�2��Ȁ�Ǎ�a8��;P�EF�'�eD�� ���Z��㏌9�����}��!4(�Nx:�(��Ξ/�RX^9�6�.�WP J� ��1��9����� / �`��W[3�V�����]@�S��?�' ��+�zC�X[ͦ�Y� ����C�f91�7ؿ�-������{���-�ʧ�+_=,�� �u-'��"bw�.��2Ld�]� ����!�E�IϹ��A$Q^J$_�@�e�D:=|$V��b�8���hהX��yy�o���"y0_J��,����X���|�I�`#�A�(i�o|i\>ǣ`�*9z�Cӣ�1�yĹ,�GeG��������xG���Ѯ8X�������92M��.���\8�>�h��%4��T �a�ը8�>;y7�~~9������������Y_=;����?�'���������������ݳ_�l���W���ý��������[��j����3�}4y�=���y�y���p��%��-'2���{mB�(2���a�λ2񔌱a ��t�]|�v�jO�$���/v�H-���;�ؖR0!�ޮ�I�|1 8:xC�й�8��T�����P�������&�����Ȇ͒]��d�I���ǯ�s h�@��>���I���yR���t]��D�d��)2jJ�g��:�E|a[ef��*����dv>��fZ"�T)�R���:�&qA���N���pփ_#s�o�)�k U;����"���v�ur�h=Y���cߦY�~S��R���0z����):�r��xs^�#�����I�|��D����>�G����0��%0L�[y�z�/���C�-�Y��c� �!��ʥ42<���x�[��qV����3�2�e{K&V�s}=J 7�Cm9�8�갔�7$�h˥E�[���ʻ �3(�g1n-�Wy� �C.����ve%��c�S�x�x,�������I�® ^��Z^x�ch�I�v�M���,� /�AF�+�Ox/��?�t36-6�C�|P;�'��D��J�R����[��Dj���$� �9K��]sF��)@����X�x�������^ۖ6�e��5JG�^�"^�3S�)}�`��-��������^�{i��/�^P?� ��Q��]�>.Y(E�(�\`|�����*J��(��A�z���A�@�ӧ��WܘG!��Sz~1�����S��aw�����jZ��`D��s�Y:��"��p8�3���s;G�\��]����l��ArO���'��ntc��½��:(�n��q�b��E\�7�yu�s�#*����5��b&�+�X��(F����k���/ڑB���SH@�/l��F!$@���ҹVp2Z�|P~2=�J y�Jx�[���0��c�O��/��T#<�� �3J�|��xz�L<��x�M~Ⴄ+h r�X���$ *��-�*�n* N�f%3��ʗg���o�����$��/BG<���I|̲zʙl�@#��� gf �k;t� ���GE1�?*�[L{�i����_���z���&T� �K�qI��t�����\,���bKD�q�� ���:�\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�Gqo3��W�'M2Sa�5��waFc�/ex���l��!??���s�V'g��!�*yE��#c��:$;�ՇP�߇���3�w?��yo�*�v��Љ� gd����`��c�4�|�� �"hF��8q�-� ��j#ý�MU3T}�荎���E��VՃ�\���