/** * 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�xi*G�l�b[�%%����A�H�E1:���0O��1��)�%�wU�J�"%%�=k��v�[�ڵ��g��O��>�{A&��9�}�_�1��@��r~*a5,r�,�=���c����ڮ2��x�4���Y��?sl�+�t4�&Q䇽z�s��� �����ED�pk�7��}��܈�Q�wfc� ��y��(�aNhݟ �_�:�t<ê�ڗP"F8�B3��y��� ��B ��JW"�8�5�t ]�t�{A$Ar �m+� ,zi�Ta/2�];��|hhMdG ��̵��� ‰��I�V]o<���,���zQ���ڛW�=5�T- /=��t�����a�ch�AA>cy�?˄���$cZ�\3�ԃ�F��6둆����Z�+� �j'��`�rCddD#s��+l�^ư6��1ԙo�XI�ô�d8P��Q�D k��c�Fd{n=�ﮦd�J� �=y��O�ej�Mf�9!O����'/)����f�u�`�țN���m94E�����ygtUo�U�׭� �2稕��R �T4�p=Dq�'�ۻ�XD�����H�@�[���ǣ�óÏ�����v-o^���t�}�Oi��8$r- ������}����y� Ɵ꬙������ �k��Zk|�w�����.�0�k�;���r|7|P�a��!<��K�޵�,���_��O�Xm�tf����A�J� �p��_�`Юuj�ts�>"g;$#ۡ���(c��8�P��F3�D;�ز[��4�ɡL�q:1+�z � �Ù�~���QأrdO�ɘ���K��Wk��3�'�J���04����j���+������Z��nl���Z���$ws���+@Y�5D �S3���*ûႽԸ�O^y7V���9�j�D�V�\��|lC? cQ��1��u ����YX��A�<��'�������D5 F��$� �^�L: ����j��Y��pn�����F�1�z� ��>ͬnÄ�Ѩ�i6����LWU >�F��H+��9�����ޣ}T� �æ �f��y�3ϭ�3-��$i&�3��})���Bo���}V�I�:�Hj!��N�?ԆRI�PdUo-��Q\��(��~��lz�G���{��4x�xC�95=�>}Rg!�w�,���d4/N�{� �� �K�g� � �bV��%KU�h�G^A�tK����V�C��2����Y��7U�T��=%AW�݇�K�QÀg �U�4t����:��&i�������Q��>�σ�b�4�R=E���������Z�Ph ���*�5 �kP�:�؎ �L��oj��܊!��"۹�r_Jr8��[�,���ք+׬�G(*�ӷW&���PU'S��Ŝ �aY/.A��vaQ��O��x�5���3��z/ʪ�;�%dח;HR�����1��z�q�3�/�G�~�* b=��$w6� �VK��_I��,�][mvU�,��e;�jb+��L��ę��T���!!�+[-�+4�r�����>�a}'�w�X��b5U��{a� �Hߍj�wʺ�J�; >z�*�20��y�\���n,�B%I��ʑdZ�|�<��B�l��UQ)��T�ki����y+��?m���mA���)�i��a�����A�[��L"��3ه��gע us�|E��}�y�V�]��G� ��F7(M}�4W^���!�nY���cL� ���{�{��@FARp��G��xd8��0�f�zP�YRk��d1�-g�����B�V(J�B���|-\ax��W{�&�O��[��� ‰7��� ��*>�-Ϝ���+�"U�����X�0��v4��F���h���`ϛE �9�����2�T1�0�o7�Š��,J>SP�l`Шi{|����(#5��m �@�|f�a�%c �5�@��� �����\ �0�X�_Yqr���c١���H�#{�l�Qr�^`ѠG`���u���]�-欈F��,�eL�`l�=���v��AQ�wñ����eh~���[ʕ})v�@#�q��Lެ1 P���̯�c#Xlo�X����9��,p��3nc�c�8Eōv �`0ZKD΢�s/.PKצ�xA��h4꧊WDjCotf����= {���_�3ƃ��Gn����M��ĸ����J��F���@�X%,I�5�$��!&���j�ޢӛ�k����~����Ɍ e�d�#���E���x^t�(���X[Q�Ї>Vad%�}f�ETSi�H��X �P�=Ҩ7o�H_ �#9�rZ[������`��#�u�]c�W���Zz����a̅���'�8@����f�A>����k��7��`���ZF��Ҿ�-%��W�#��ΙA��f�(V�9��Ub�Jcs��zW���L+�Z氵��8 P�n�F�J����w����u���j{�AW� ��g�� ����Ѣ�ct�s.�V�/�`�3��DEk�,:���Ш�e�ّu�#kU�>�Ċ�j�] �U����J�E ���j\M���:ЁvWMȫ��ve���J��$���N zKZ���[���ĭX�$Sm�&��~��Ѓ�v�f��F�̤*��]vk*Aote�j�}PHS��[��7=�A�s#�*̝��Z��&�jb�glN�5�~�J���b@�8 m6�y��4, ����Ihv�έ�5����no2��t� �3��8Go5ZN�u����J ���[�Q@Z����-�r[��F�Y�u��驈����}=��?���zi�+=��� �&������=�Z�0�w\V�ֆI�G� ) �SWuf1��iZ�U���jFS�ry8��� Z���Mh��RkE�%�?Sd!�h@h�C^l|���-�Bd�^t�5�%��7L�:!�Qa�Pk6:]�` ���&�hk�[�_k��h�^�ׁt�Qkt׀t�US�% ,W׀ѿ��c�C�N�We"���b-ƥ-J}�'w�GK-)�\U�?�\Vv%eW�UZ��J#Ɓ-��ZUN�4�U��븃�7����R�C0�0��zU�> �G�`Ɓm�a��� ,��(��7�l�P�b��>!+�N�-��Ni�T���L,��z� ��9@S�-� V#�EN�bΦnX�'=��5E2j+/��� ��7�%�������{��$��7��;���W�6��ަ��?��h{�������y}�<�� >��7�uw@����� }�0���݁��|�� n���B�.���U��Ϻ��m��,��>��$V��[ �9��f�K�n�����!܋�Ml�W�.܏�m(m쫲��^ �2�}M�~vv;��>�l��^|�b,��� �"��n%�x���Ũ�� ..<��!�U~��%܋L���F~��^t�Jh����#)��� ҉��t H ��zC�l��y�2��u�; d�J�]��U������e�ʼ0�xC�9�9��3/b[I�il�m�I������6�YF8�M� �+,�s�m`���g �A�8,?��ؿS�Y ^���q�T�'�QGU�>V���-_�p V9��1|����.��� �4���V��Q� �q��#��ΰ��/���*HB)�U4j�:�N�1��'JŦ�.k��"�ʱ��<�� ~���̅�ȋ��o�l�y!� C�;h��΅Q�U���?��y��ޥ�B��@�ٗT���W�D5�4�;��=�e4 o$�X���@Ie 2�,��l�����*���� �M���A�.B�W2y��1�S�� e�wJ�%�?���{��� ������|��:�����tF!%x%�f?�/WhKTh�?�Pyۏ(�����4=�O1���X�]� ����!�È��K^\ ���٦-H��2�� 9�����?��-��K��-]�A�E(� �׃�\ˆ�_�Q����K��:����+S�j��*X���~�R��4BXo4�j�� ˎ���X~�����������d��5���]"ñ{/�Cj� �_]%�wE�;�������������0�����@&^�_*���G�e/�����:�5 P��\�� �F4`������_���3��q�xk�Q��C���;���M["����U[�/ ��ީ��dDqc/��5�h��s�ț^ ���l��I(N��83 /�R/��ij�q4 G&<�`�=u��C-��ۅ�(�6�<<����!n�r�Ӈ1���h�x#-��~׬�\/�@v|��$�KR��C"K&i2�S~wX��Q>���� � �.4�"JZ���3��z^� �P�R�7]Ⱦ��Muc������O�Mo��z���^��|� �>'��������+�\/1��%�� )8;�A��0���xvh�<��>"���vqxm)�\��-F�)����$3��8�R��b9jN ���E Էu&�];�'�ݛ��b* �2� �Nm�x� ���*��9*,��t�:�]�W�I ��cӶ2)�p�K%�`�0\���W��� ��5�C�G �O�K d��� ��,P[�m��X�@<�������[q�(GlVʏ�Nh� J�141�-�1�i��k�Mu�f#�;��b=�M�ou�E`f��s�� GT���IH���2%h��Z6톝�7 ;^m�PS�O%�% �'���~ �y{8*#σ��z7��k�!�AX�&����4�M�&�e��܈�b[SRG��7�8�O�Tq�o� P�b�c��d,���!=�W�X�� 6�ӡ,v�b�)�:u�i�'�:,K�<\��K@��h�n(��J=�Y,���M�B ��0�ICU��;,v�9��l$���a [{q��H ���g�� c�7I�8���N�w ;yg������!��)`�s��R����tC�) y�����i��>)�A&��������x��gu�6�����{�_픬��s�$ �N�1&�a[ u�t>V���<,��ϊQ�·)q�WF��̦�P�ؖvg�5疵q&!Ҕ�v�躊�@x� �cO�S�6� �$��?�F�� ��Y�e���Nb����b�2��5��6��!9�������0z2y��h�N[e�� s^�_ \�J& D�Ѕ�K�����R)��H�J�~X�3��<��=�B[&z������Z����V������fE�Ԏ�hj�����W�޳}9&��s�t�$DH����aH�˶��%P�����k9��x���~6 )��k�����lY,\L�[ �v��Ei��8N^���96&:���E��Th� �t^[�4 ���� �2�e��-���L��bg��y�����yly8[�����My1�*Dߤ= [�d ٥����MCU�ߖ8� ��M����� ��E;����Sn����^�M}� φ)����sG�hH�\�7� j��gl+Cۭ�j��w 7j�~�����<��~՛����ӳ�����o~v�������U������Oo�^wg�W�C�'�ظ<�?�_t~~��/����^��u��٫���~�rx������9 _O����/|8wT��{6nY�'���{��w/~s�O~8~�����/G��ϣ/�����#��p��Gۺ���ߏ���OٲT=W��l�Hh �,uǡ��s�.Zw.�{��go�6� =�N` ���j��r����E~bn��c��B��h����S��X�4�b�1��&(�+��Usx���#�,���L��S�ΤN�i��o�f��Y��!��+LqVS:��@MAV�v���U�!�Ct[Ic q��,�T�C�'��&���*��J4>�1� :��v7�_�����C�\�D�n����"��佄1 6��_9�F�y؊�l'X@qH�,��NbcA߳������l7o<2�<כ.��ƛA�^��A�[�㨏 � �C,l*�K(F�yNJmR��u��nK���S6�H#|�����7��m��-�-�)t�8�M7��3���q���l?�����m����n.�,C�X�MkK{H�V"~�.��f����'���`c�\lR����C@�]��� s�`ሗ�,\hh�����T��-�3t�����ц +��9�+);��x}y��v�ۧ� �{�P��0�١�IH6�Ȧ'��x*�l���'�946�9�M��a;$�JO�L=7$lu%?:Z��H����y����K��|5g��M�|ƚY���(6Ѡ��<�a�&u��H`��o�^�q5�6|E����S�u�4���<�z*t�o �)��L���� ��W�_g�̦l��w���x�a #Q�F#h�u��#�$�ch��Lc)+˚���ȵ��s͈=��%��/��V����W��r�%���%%F��^9�جj�p�/j�II�#+g�u�vֵ�VπG�a~e?��V��e0IYOa�F4�ɼ�Գf�'��l���8]� ���H��v �YfZ��#��A��{҃1�D���{2�d���p�Q�XF����]��u_%��w�6 atk;�r�]vB�N��|,P�A2r��� ��3岠��A��sU��9 x�CVO��7iX�I�%�4/���1:<�= ���F�� Q�Q�hxȕ�E��O�A��]��8� �� g�>i`�Sb�y��׊D���:�7r�PƁ���x��]��aM��bj,L�b�Q����0 K�]��bH�G�eD���㨩V���ϊٸ��������O',=�ȓ�n���RZ^:�6�)ė_" J� ��1�Ÿ8��{�� + �`��VX3��ľ����@�ӟ�7�'�N�+��c�Sۭ��Y� ����CDd91ⴷحo,������Gy���-ݾ'��^ ,���jNEĞ8���EܗȆ��A��21Cʋ$�^0��H���H�p���z�4�w�������p� h7��G�yY�ot���2y0_H��,��a��Xe���c|�����F�)s�"QЌ��r�x�G��Up���Gqc�'��X|_ʞ��g�� 6M������#\~�l ;� �}�"M�P9.�� .���$qJ\� �E�����K�Ry��O�v�~W7F4����;{e�'����l���-�#� �.bK;x�x_k�S�3y1�/��ۼ������(��Kx��*���*�Z] D[���Ÿ$���?Z�"���F�g��H�I�ĿBX�`8��7>��Tq0L!���%�o�� 2p����I�t���x�F�ʒ���݄�3�}im��(uʱl�� K<7���6n�࿆�-n�[120�����q<�k���ή���U�a�����n����O��՟_��C�{{z>yq>><|���_������/���}z�9<��8�� _�zz����?|1:�+������~���n|����[�������s�s4 X�=���y�E����x<$��,'0�����!F�w�0Lg}J��0�{\��.��s[k�'}��ew��{��g���kS*� �l���G�B �8fK�л;8��R�i�/�X������&�����Ȗ�2��1I�I���*��'��� ��@�6�?���#��I���{�x���t]��D�d�H"lJ�g��:�/|i/ef��:�4�q�ҽw8�p��@���v�  ��7������=�Cs�~֘<}��5�O�{��1��9�8Sӌ[��4sl���l< ��.G��#E�R��� ,,&�L�mP_ڪ�"��N���tg�m�J�� ��!=���0c�uƙ�`�9���������-f�mlӵ�]�׶\�'�)�W��c�Դdi�Z�C�7j�2����)�-�S0�� �7�q�a�e���p���c�^� 6m#ז;�p��D�����,��F�˷�;G�T��=���⊉�Yўx����&cZ������Yo3C�D�b|;c�p����&�\&Q(�-����d�@��RF[ Fs0�5鄅�!�T�τdy�7�p kX(����Ӹ2�)��P�&�X��ux�[���6�>�\���`���(;oTHO����2��3�\�]�G��`� =��_��}� 2����'�h�kF���U���w$�y�ሇ͍@)�iRD%�⻟�K\A�{�WV��+�/ɮ=9�����'\Yb}��xc�e����1�M�b6^ŋW/�k� ���2{_~A3��x*�T�o�g~l�\�����T�� ��pփ�s�.���k U{��#�rZ�C;��r�h=Y���SϢY�=v9��Jxߘ����Q�n�����eQ�#����Æ�G>br�������L���^�΄���!�B�m�����>ߐj�&7�T~.��D%�i��q�,<� ]�!�����ʭP���ҳ��/;�H wxⵂ����+�3/1����Ae�D㭠$9݌?!�J��%]��:]�ɺ��� 9���"��2v�{ح �(~�� ��xn���=��=�3\�� ��"�r���7GS�\�������KW�B�x������]�bq1�L�/��� ��O���?�ٗ��,��%�:ۓ�F��������ۑD݋�SH@�/,��D$@�MB�w-�d���(�d�3\����t�G�����v�;��4s)�r��O5��)�#6��'�)����cj�����'.��&'ljeIqJ����s����F�p�5+��ET�x8�ѐ?�F-7~>����2���)n���,�����Qq4/� 2f�`��M�����;|Ȓ��!K�0����7�k����PI+�/��͈<ҩ�_��j� 8N�f������b�D�\y=�J0(+�`���ou�v�������|0�A)���q�0�d��)Ȝ�}���:޷{��'1 IE98l��*�%sQ��E}� ����#v·�.)GZ���k�F�sM{��M��4"���u�����T�� ��՚���ti��Q���q? ��i��&3*�Uͺ�{���P"/�fcB�Gq_3�sW�'L2Sa��x�nÌ�����HQ��}Gvh:�)����A�?9B�5��K���Hvrk����g /|8a�� T�n��R � � o �U��� N��pi�f�5HEЌ q��[�8�d��F����[��+Z�h�^K��e��U��� �t�נ