/** * 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���_��g��L�3��=��y����\��B�!�iѠ��]jzc'�� ���*��cz����b�^L�����E������*�iMi#�����t}�V���9�� �� � Fg46�55È�C���ғH#���J���0�� 9�.;�mz�XTa/2q<'v�|d�.�M�� ����������ܳ�+��4�(�;214����!�wB���NJvgf^*�̜P�l \3��$��)z�D��󕂨�<�%�|� O�E�( �R`��|t�$��� B�1����s3��oɳG�O�?�o��g���E@g�g��@b�!��FfDOCWN?6>6"�B����k��G��~l��z[����F׸��,P^ � �D瓻Ⴢ �}����P�T\K��tX�����N��,wn#��K`�/ � ���9 ������.��9�:;.%��2� ���h<�,4�#{��s3$��t7I'V�֯�������h��>�Q �;3x2g���� r������ѸV�ٍh���Am*x�A��/�t|�V��N��U-��o@/���ܤ��@֨j���{j�5M�dx7=��� �+���R�'P�����.�<'�4��м�Qu������4~w�.O���� `���GE����=7�rG��?}���Y ~�Z��:�ܳ�{n�i5|�$I+%�.� )�z; ]�eU �����6��T�#}$Ud�DV�F`гZ'���"J����y4D���o~����\d�ǖЧO#�!����Y� ߣ=����)���� ‘!����A�p)vl5�[�T��a����4ɰ%����{m_��9��W�G�M]��5SE��$走��I6U���RG�HӀ`j<� �n�� �_@ؚk�k��4�k�LA#H �S���q,p/���n�F�5���D���4�Q1(W!R��}0u\�M��߅�̉@�5���E�s;�6��h���HYX�'�S�+��׬��S(*���� �PU'S��ł մ�� �k'����I�Gox@��z��s �e�pÝ������)Y�A���8 ��z�I�3�/s�5�}�* =��$o>�0����询�y������z�hP��N���J>5�9%>œ�c�4$�yi+�y��R t���ӧ�KX��%VA?��X��-~�E��k�wc5��Y�[�'A‡R/��yFr/��Ͼ����,T�= �I֠����`!���捀\� Yja]�ơ�Z��������{�;64~ߛq��y�jސ��DAP1��{�U!��k�<��;x�O�Wh�+j���#��58�B�~�ڠ�5�ae�ӧ��2oΏ��t�Jd��c�_�]߽7�G9d$w���j�H��L��֗|[�j7 j�b��,f�����Q��EIXh����Ws���1�g�{}@U1vx��…x�!�xCKI��`�V�#���9:���d(RLj�|����5����V;lhM)�w�cw�y "YS�� (cF+���f�3�x�ȣ�S *�d�������k��Ԍڎ9���V�1��18�0���3X²�����NP$��X���ʊ����-ۉ׼����J��K�+����tvg�Q�G�o}Q\g����&���n���Q@(����i�1�&�a�f�sX�hױ�5�j*�hǾwv�Z��|�����n�xE�6�f�i�rRB�v�Ѡ?��n�x��v�Ŧ0pgs7<1�,�s��v:h��%�j��L�v1��3w��m:�ɸF���8��9I�� R�J�<2MOXt������׊ �t!��Ō�cFFQ�?�fH�Y쮂j)�i5�+��Jk@���-@+� $g�BN�(}�������z��t�@EA� �c��T�XW��s'�*���cs4�Ye��ԉA�X�X��0��R%cF�n�6��p�ιc+!���Ԡ�p�Z�?�D�"o�y����U*cb(�E���"�]A�2�xwd[��*� �0@�ze�+%Q6rߣ�>�V��Ck�~�.����E����Ӳ�t�s.�V�/`�3ôDMo�m:���Ȭud�Օ �+�u�=�Ě�n�=[u�kړ�R�e g��j\N��ЁvOK�k���d���J��$��%�J F�ڲ��۲��čX�$3m�&��~��Ѓ�u�V��F�̴*�+$��VT�������:}PHK�����[��"� 3�)̝���J���ja��lN�u��_'F^X1��V���Z�<:I����^�Z=�{��@M�%��ۛ �*C�����[��Sc�9����b�vf��jÿ:i'�AK��1ֶQ{}YCĦ��F&b��NA�������H3_�[�o���n�`���s���;�z�6L�=B�IQ���f0�э\3Л��u�V3�9����U4dЪ�O���`K�%���k�� ��� ��R y���*(� �Mg�e�2���� ��G�a��j�t� ��@:� -�W�1_m������@��T�� =i�Z�����0�7�@u�� ���L�?�(�bRڦ4Ipr��jk�[�J��0�(W�]J��h�v���Lp`�#�/�.��E�2 V��U�Aɛ�Ŕ���:�0��]zY��� �G�`&�caF�}EJX��Q:��ޔ��r"���F� �3p �S."{7I|+�9�_���E�nj|+ Ä���ӡā�U���kiE��ڪ�����1����F{��9�IYujF|���[1"&�fX[>ʩ�'8�rP�&�r� �l�&:[�#$��'����F�k�J�+pU����,{; �߉+ZE�<�X{��R]o��\l�Ed� �"-���MіJ-������"y�/Oz]/̂=�'�����}���5�}=_r �{��P���y@�k{�{Ѽ���Un��m����������?��|���s/���|}_w�k��;`]ӷ��|���ϗݟ��>�.����\U�����F��΢���Lb�o�e� ����a~=���ڋ��a�½XZ����q����܄�ھ*����U������$�gg���C��*��G%��x���p/����L��^�j� ���ØbZ���Z½�dh*hW �E����V�np/* � �l� �ؿζ�T`,�7T�˖��\g�BV���1^V�����8]$��� �7d�ӹ��1�c��4՟�f��6�t����]os�mFS��辻����u9x��%���h�tw,,��FZ� wy�Z��eܻL�2�N��)�`>��5%^j��N���z�V��4��{363��(���"s~�����"�*�A�^�;B�՝��'�T`fey �v�����?b'�?Ϣ��k<� z��C�L�O���ɶ6>�1�1��� �~Sm��ʦcs��?'�uRV��ku��L�΂"����)��`��#�{KwD��v|ݣؙ��ƒ�HD������a)D��)ō�X����9�5omI��ϑh������t u$�Lo5P>G�^�ӟ���4�"o�o�Oco�Q*�J�-@� #qo��C��q>�%�?�� ��s��-\�A�E(�J�g7�$\ˆ�_�������s�{�:�%׭�;U�j��+X��.�ƹ��i�����F�� ۉO��X}ً]��������dXj0 �D�n������I ů/��;�"��� 6�|���y�Yy�?1^¿�X �r�?Z~�M�u۽/����:�����/Y� ���xȬ�(;Ƙ����?�[ic���L/�p�Gw�؅��D8⇹˺��~H���UۻdLq�/�7�hM� Fk�?;�_�x:�%�8C ��(: BH=jS�V���F\�����3G.�e�ogb���K��pH�,�F B�˃����x��S�+h\5�V}��q ��+̨�&y~�Z�Y:u���+�*���1����X�@��������Q:��Ó��j^�� �P�2��]Ⱦ�:-mm�����O�q����S�&D>�5 D��=�e�ٍ���h�\���F�]�HJ�O��<4~�pQ�_Y{۸k\]�$�dq��c��'�]��YOC%Qt�5'�Uκ%�ۄ:�������m�6y�ɑf'<���DLc�PUAH�� .�k�D7��d�L�!<�\�(�)� ��jh�@#�Ff��B��&�'�%2��شb~n�#ć6�F�{ >x�R���ɭ�t��7K��n'r"��Ț�ؖ���u����5�;��B�����j5�u nu��`f�� �K GT��nOH'�2hĄ[>톝���;^m�Pi�qO%� ��[�~K�|{4A�C�|����5��F� �~S�O�P�ϦES�2�YnLE1��)�#\wI^��'a�<����(X�L�1A�X26_}쒩��+M�,X��P��8`��L��: ����\V��>.l�Re��d�Yt���^-�����ф�0=az���=a7[l�rv[�>H������>d;��ޅ��[Ʋo(� �q��q �1��=�@��� ��A�C�,K� �BG��aߝ놞=R��1y�����+|R��\�ѫ��WNj���7��m��Q*v#��)]Of*I���l��/�Vp��� .`�a��~V��Z�MIz��0���p>E�Աm��$���$����d0� ��|qb�04���gx�{�z2��,'�lV�7:z�����v�UE������������I��y�/P �}p1%kK�(�,N���- ���n��-7�>k��e�6塠��ӌ�|�� �Ћ�1��T䟄ѓ��߉��v4��2U���u��@D]X���X�j�!Q� �����E:s���J8��j!r��iё��P��Ņ�d3E3��f%�f��Y1t�k4[z��һ}�!�M���8���&�@B��81 F�l{t����_su-��ɭ���%�|e�7�W-�EW����F"���qY0 �ӈ�=n|���nb& Q�8A��1]��+�R�a�F�%��|�!�(-r���!a�$%�o���>N\=��|S�E�ƚ�7YÖ@YB~��q��25��m�ÿ�?�ݔI����`�]$��K����fFn��K��o���#%~�Qy�[�h�׳������8��������M�<��7����E_��?~����?G�l����݉���<:~�����~9x��۷���y������{h�F���ݟ_i��K����{m���j�j���N?���`vJ��ӓ7�����O]���;���w��N��������ϧ?�m������������/��D_��_?��G�>�����W��\ ����z�f�� ��Y�C �v]��B2��{� �Hl0z��Pz=��}�1�5ϝ ����\e�>�bQ� �ǧ����ia�ŀ&��LQ WJ��0�p+�G�Y r�O� ~9�@w�K����+b߬;��e�C@W�%⬦��������Em/ gh�C ��6���6�y��X�ON�uD��T4@��h|.bH1����� ������W�#m��~Pq�F����k��|���>lEv7,�8$V.�0�:�":��}ϊ㝱X���k��n<6/}ϟ]-ʍ��N�0��7�=���@�S�1�X"\W��P�@1�[��[�n݆7��)�(F�ba7P�g��n;6[�S�y�㒤+Uʁ!a�+����UZ{�t�7�;�/�_��K;�d�o�3VL�󁲩�Q�� 6�3�eZ�)����w��+� %ĭhEo���@k�?Ek 4��9�f����#�+�ͮ@��?� �S���;�^q̼�p��h��1���Tő�sZ��T��c�U�e�iq���`����Ԓ|@����p�|8�1_Ѱ����<��L�V`�M�&� �]X��ˋs^��>�e��VM��������n�M�����COK�O�1�?�a��x��=~�?�'1�_���Ll�B|�NR�܍����zG5Zj`��6ѱd6�%�68`kZbu��_�+:�A��1Nmr����F�L~n�TL��=���GCiY[����2hO�{m�nw�l��{�Y�f��B��OL�A�X�Q��Cۿ�W)_V����k �B�5�u��E�g�=�?|I.g� ���.B��&sIz��ohF�0�P�+�./z,�^ԶҒxVζB����z#C��¾������8����Z��? ؘ��ܥ��T�m>a�f /������o���m ���bg�@��;=��Y�T+����l���86�������N���i��BO]�G�Hơ ���mr걣�w�Y��'�n��9If�v�sb厂ˁ����X?�n,�m�x�u6J� ��N�6p��g>�K{���})�G�ĸ���������s�"��s�ݭ�L�}a��"�aT��8o�iM �����?EP�!-�D˷��Y�ȁ���x�矛���\��*/J��,�M�a0���o�ň�G�eLF�I��V�6��5���;pmE|r ��x:a�xr����@Jeyi��4�� QP�Dg����-������v2�0��� [kΩZ;��W�w N��<����K�z�x:�:���Y� O���CĠ1���@~}/�nj�$���'o�FF��� %�p�+�mjI wH��*"�T6<"m/��RQ$���D��D� $^VK��TH��@I`�vM���!'/K���p]%� i�#��=�R7L������h>�9�H8eNP$ ��� ��9�*8z��14Ry�I5��e 휱 �w���v ا�����.�i���q�6Wr�D��<%�S�*���~�0mJՙB?�a�=K�Iu,����*;9a�}en�+A�1v.�,������zg7�] �g��,I��ka�(�*�{���>Ggz��3���P��k�.6�'B�O6�e��W?�5�!��~����<���I2���+��:@�gƞw�fI\� ��'�o�� 2p& ���f��F�d�J�O��#��3�}a���(u̱l�� K<7��6&6�9㟓/�M)9�U���ل�A*Լ�.�S��p���D�0L����ⷱ;-������ ��W~��N_�N������ד�_�������C��?>q����`�|=���������ͮ�����y�?��Ͻ�&������Ѿv8��?׺����ޟ�_�_~�L&�aj�̂p� ������qlZS�AB���2������=.�v�F߅M�ړ]��gfw݀{��o�� #rK��;���M_8�K/�wwq�a[�F�����@O_ ,K.65p�٩� �et>�c���<>146i�O��& ,�|�p�� !���H � ��'�� A��O���M�O6���$¦�zVn/d;�v��� ����V)����/b�{�>�i�L�܅� {��<�;Z��(�0hq �Ȩ؅ ���So��[0�pe@�04nv ��k�Dq���\�oޕ_X# M��3~���l��������h��-܇Nd��g����=C�wI�l�3A>��d�y џ��;��?�̣8����I�r����� K��í��M{,�(��+oo��(ܶ�V:S ��K 3Xe�� �K�c��m���9�²n�?C�� ����I���8p���V,rT�s(�C�\��vg����&��7Cϖ��d����j�S�USL9�j�����\��y� 9�S>�a0�A�,dWnPɦ��Yj�n���ijW�&6������\2���z��d$"H���;��oe�0����0�B�Po�e�e����D�r�b�0��!�E�, J���S�|&$�;���SX�B�d�n'���H�Xg;O4��n k�x)����7c�0L���e'�J陑���@��cƗ˻�`����5C�x ��~�w�̫���p��J�7��j�d�Z��<$!�h#�{nʨ��W|8y��\��V��+�6/ɮ�ك����'ZZbu����c��{�� I�2�CF�B{�_��S�bgg��/h�5�Le�:��|�c��T�$%5w�N�n��Yv��1�4�F�1T� ���Uh��Zx�U).n�I�h$D�����r�K:g�aN��)@ձ�*X�x��+�Z¿x�����.��-�;�)�b�/ʀ��-y���������1�� @�!���~�%z ����>.�A<"�R�� �0F���4�d)�~2‘{��� �+i��ځΧO{H᯸Ȓ��CL+������F�1�l�D�~��iպ�Q9Ng��f�m���$�O�򴰑i�͛��N���?��ӹ�]�Rr�Cz�Fw�� /\� ����K/v&��%�X31?��g8/5�X0n������`&���!0��f��iݎ���v$Q�����3ہ$�q 0\��l�� "�������qZ�^�Q(߰�Y�B�e[#���t7<� f���|�2z �H<��M~ Ⴀ�irr�X��� q*?���J�nd ����UD勇�9���o�����<�/C�?�%K��g��1�8*��#�eyA�� ��v� �z�_�d�;���w���L�_7�k��5߫�PE+���'�{Jy��_&�r� 8N��- 4��� (v�4���7��