/** * 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�xe*[�l�b[�%%;���@�� J������y����?�|�Tu7�)RRr��%����uuu��������Sw��!����� Өi��gQij�\�����dX=����^���hlMvx��4#��c�C�N���8�JJ� U�1�H<@�f��eƎ�5�(��j�B�d ���h�]���dZ�44���{�%������!����)�_�)��(��z���Y,��� ]k �(#�L��RT��������9499��>cz7>�f�-ߒg�>�| �6�/��/��ˀN��� ���8"r- ͈�����~l|lD��� ֈ��P�!��`�?6����͏��q�5>6$Y��xcx�.�w�6���#�'|���Կ�� �ݰb��U���Y��F��#��0(P]��� :jW5���=P�#r:q"2r\J�/z#eL=6j��h�Yh�5G���fH|9��^�N��_���Ń�h�>�Q��;Sx2�A���Kr�������V�ًh���Am*x�A��/�tr�V����Ѽ��7�k��nnR�A h kT�@��=��&k2��؋�{���wwuH��S��Z �Z}� �\��nah�kTOX����j���j���c<��M}/��,�H�R0�y-�WP_�Zd��`~�?��3�G���-�(i�c�/ "����5-�=5?�FT}��f����)�R�a���#��������T��Hr��O�9k��aK��V��{6r���3���$i��s��c!���Bo���{� ���u���F0��j�����Ȫ� zV룤ֱQ� �49�2���������M�����iD��^��=��{�����8��!3��72�6���B28�.�n�&qK��9��1���!�$__B[ya�ː�1xw����eP3U�{J�N �?�dS�ph u4�4 �������&m�������Q��?�O��f�4�2=Ř��������jZP� J�H�r��هǵ�a�T��]�O��[�!� ^�;��k#I�x���U|�=U��hp��|<�2�"9{{qe� ~ Qu2e�OP,��QM�~qr�v�{��tt��Gï!��A?��{QV 7�y- ����A��ut��~�#�Z�g'=�2gT���gp�� �hH�f�! sij����*��g9��:Z��i�f����ꩭ�Ss�S�!ʹ�1fACB���" Z�Wj(�@g�_?} ���3�Yb�sh��L�R�G�P4h�&}7Rc��u���w$|(��Q]��`� ��I��;^ ,�B%I��ʑd Z�|�<�B�l��UQ�����k�����y+H�?k��cC���)�i��a�� ���A��[��\"��39���g��z�F����>�}Z(/����M��D�x�1f�%���{�{��@FARp��G:���xh��д���zP�YPk�Td1��f������B��(J�B��ܼ� ���1<���}����ӧ�.�c ��ZJ Uˀ�k5>�mߚ���K�"u��ɧO�X� ��~\����ф�x�8�`ǟ� �5�����2�T��(�o63ÊG���J60h��n��6�HM�혃�)�7`Es��s #�k9�%,���[8�E�)�5`���8���ڲ�(p�y�p$�3� 6�xr�~hӰO`й�u�D�]�-消N��,WeL�p�x}�Mպ ٠�G���:cS4u��8���Vr@_�]1�(d�l�S;+��8t}��:�� 盛D2Vĺi���F�0 2&��ƌ���N`q�]�B������Y���9j���]?�?�F{����4�ݦ��MH MۙE�]� ��rƃ����(6��;���IeA�[5��A���@�X',IW��f���!&���U�h��M�5Jv~�y���H�dN�*V��iz̢�T�}?�V`� a��(f@�02��13C �boTKi�I��\ �TZ}�l�n2�X d 9�rzG��;�ݕ`��'� �Sc�W���Z���~�a����̉&�8D���{V�A~9qbP)V+�l%L`�T ���۳�n5܅s��JH��<�F5h5�;����"Q��s:���*�11��"�py���Q�V�;��a{�p�j���䕒(��Q[Y�p硵�n�.����E��a[�e��,��\���_*"�6g�i���l�t,��Y��z�+FW��D{��5�ݖ{:$��D״'�����h�ո�~M7 �잖��dC��zS��z�I K�k���<�e-S&�e]���If�`Mb5�)�C�ʭ�q�2Ӫ0�Hv� ���ٓſ�:������o#o���4/�p�0wΦ+ v[@����9]� ���:1�����4`�����IҰ0ho��i@�Փ����Z����ɰ�2�H��qo���h95�ᛳ�[(� ��igFi�6�_'�8hI�;��6jϢ/k�ؔu��D��E���������H3_�[�o���n�`���s���;�z�6L�=B�IQ���f0�э\3Л��u�V3�:����U4dЪ���oA�����Kj/�� ��B 1DBå@�b�3�UPl)"��*���e,�E�iA� ����� �tH��t�+@Z���oc��^�C5V�t��6{+@z�V�N���3a�oB5���?� ���L���Q�Ť�Mi���.���*J�����a�Q�*��2���*�bq�����G�_z]N�4�e�ɫ���7�� iMu"0�90��\zU�� �G�`ơca��='%,��(��n���K�  ��c#d��)� �)  �}�;$����\ԯ���"�c���a�rd���P ���ԋ��d䵴�HNm�EpvU���V��U��Q�Ѥ�:1#>r��� 3�-���G9�Y]�Xf6Z������ē�W�J��5q����C���V������D���Pi���Tl��7�\.��"�q�f�Z��hK�����FHy� ��͗'��f��܇����>Dn�����/���=�}����< ᵽѽh��Gݿ*7�\�6�M���E[��ݟ�m���� 乗�yw@�����5|�������>�T����Op}vZw�]w���|�]Mm#_ugQ��Qw&��7ݲ`��ie�0�XAw�ňu�b �^,�C`���lu�~ nBim_�_|xH�*�W���k�����W��UK��ce%g?���{<������| ����E�z6�y� ������\|�������tF!%x%�f?�[�ж��l*���$�QlyKyYzn�bN�1��P�,�O#��sV�����@���3r,'���'��҉'������c���o��*�9�`v�[2Yj?����g��_��խ�?���%���S�`-!ևG����ca�l5�JV�� �Z�.��eR��w�UL���\�)�R��wb,�ԓ�J6�� ܛ��1�-@Q�l�󻵵V�AT� ʷ��?�Ww�6�\hP��u��-���:H ��������<���@�l3T�;�Q2�?���$�~���� �|*�.��M���>�P6�37���8鯓���_#��D`�w�?��,L�\�LA�[�� �g��C��������D""��� K!�k�H)n|�bխϙ�ycK��D�O@&0�K�#�g*x���9��s��|��_�qyk�x@{��R�P"�nbU�{��O���(���o`���ml��&�/B Pb?�($�Ft�z��7���#�cׁ,�k�_���T�.^��w�w4.�N#D�f���述������7�؅�^ޟm@J�����{@����1R��P��2���)B�A �`̷������q��%�� d�U.�Gk�/c���\�����7�S�Y�����_@�Ԍ�f��c���$�����12/� ����qpt'{]��K#~���K܋����]��GF7�Rn�`M�t�a����!0�����=��0���� ��s�6�m�Mĕ ��Y�O=s�R[&�v.�* �kϒ�p���<���ً�^??��(�.���m�3�.d�k����1�ӓ��ͫ����(�X���*g���mB����n����Ͷ�3� ����H��� ^CC"&�J� �*� $�Ύ� W�c�����l*W&��y�D�ƅs���2�B�����x��㨉� �x �L�56����񡍰�����4ssr+.����R��ۉ�HA)1�&&��*�;#��}j �����,b�~x��Ƹ�`�-��̌�tAs�� q�� ��}V���n˧ݰ���`ǫ��C �L6��亂��q��oi��c�fC�|蟯����&\�H��oj�i��٤h Z�2ˍ�(F�5�u��.I�K��,@��p���+�I1&�@��k�]21|�)s�K:gc>*�,����TQ������ê���eM�,T��v��"������B�ܞ�,����� ��54� ��bk�����A�<@ư���!��,��. �ت0�}C���#Ď[���s�Utf�����eYV0:�d��\7�쑢�Ǐ�ۿ�4�_ᓢ���_��:YLπ��y�@mCX�R��8�uO��x2OI"� ���f�9����$��Up�;�,��"EԲ�mJ�+$���m���0R&�m�]%YEM%�Um�&��T�,�+�����=�{���ԓ�Md�8�ds���;E��g�s��*��؍�4��D�\6OZ�λx�!샋)Y[���@�eq����Fl�i�?t��o���YÄ�/(��)�fL�� � �Mp�^DN�栧"�$��L��N�V��1� �����/�[%�"B���%�Ǫ�z ���TIU$E%@?,ҙ�f�V�ɟT ���L�}�K��///�$�)���05+y5+\͊�k]���w�-���5$���bLBg;��8H��'&��aÐB�m� ��}~�5W�b�K�\x�lQr��%�q�w�RY4�}�2፷��Ҁ1q�D��s�sLt3i����ќ����\i�j��7",A$�� !_D�h��+�%� �$) }�����q��9����.b8�4� ��z���˽�ww[���c�mq���M���ګ f�E; ���]nf��8����f�M1R�w�现5Ј�x1{`��U�|_��Q������,�n�A���<��-�b����O'���9ze����쎵�G�ɫ�?���ở޾�:�͂/��ݟ�#��(򿞽���J�^^oO��k���W�W������������g4z=9}ؿ|���՜߽�q�~�:���ۿ\�{��|��������x9]�<��������?������_��h�����)[����*`6�� ��%��8��pn�e�.$s/�� ��s�G� �7�S���@�[����O��UvL�Q(M�zz|J[ ��] 8a���r��{Z��|d�"�����Ws*t׹ԉ?Ϳ"�ͺ�\_6 �1Dt�Y"�jJ�?�)��\���p�f<�p�n#i�!nB�E�u���,ZG�N�AEt�Ƨ�!�����o����_Qz��:��Z��m$��Qh�vM���ת���Vdw3�B�Cb����(��X[���8���ɉ(���N�v�c�����|Qn�-t��ĸ�� ��(�"���1��¿�b��w��:��zPw��6���eeMAE1���z=�~�v�ٰ�b�B�S�t�j=�}�ZK��� ��LH��>�� ��2��e�!+�Ncm�)"��H���9��j�֔�x�l��u갹��u�6k�8�am,�� M�ټ]>>����t��z����0#;�fE�1�b%���/�y9�w�Uir/*�����W&��0 �f�Tcj�w#�"%� ]'���#;��&0'���3�$]�R [_)��n���ڃ�C��޹�xc��� _ٙ$3}���bo�/�Mt� ��]���)-��(٠�w\��M_d !nEk+�v�����o�*Z��A7��kهѦt� ��\�_|��˧���w��y��#��G#h� ��#'�$��h��\ �*����ɳ� m�=V�%�pgc#�6�d�c��aK���yA��|���tM�r�������|�� �M��"?���<� ��:�z��v �rg��l+bf =�&O�L�;{�GO"b޿ �������Qbn~r�F�(Uk[�[��T{T�{�%��.��>[� k�_ѿ�i��$�qV����.�d�����;jӞ��(��Յᄩ+�ѳ�a�n� ���p����5�/�>ַ�u�Y]wb� R�j��L�����B�zOk�]g�r��t�6��= �Q���Kr5u��o\tK\6�;�www��0  �h�ϕ�E�%�����VZ2O���VCH5tUo��ch7_�1�RS���uy��z> 7��GSߞ����j�]'���lŅ�;��y���m���>t�^�?�,b��}4+�����������Ɔ��}\X���>Pp�<-�fW�+��84�Q=X�M�Op{��´)Ug ���Q��fK�$ձ�~~_s���L5���-F|���ȹB������>��;{��J�<��I�m^ [F�Uq�+t�9:�3���ۅ �NW������g��F���|��]#�:~�� ��I�b 9 �$�I��X�`8u��y/=R��%�B�Mo��f� g� n�9�lF�o>K�Ě4�o+�mx;C�V�߉R'����s3,m]bc�s���^y˒؈��Y�cə� �B�k�2���G��YA��>����~ �Ӓ�_����~~5������������y _==����|>bO���S�������S)S.�����`a >m��U�Q�E�}|�-�ٹ�ۖ�JgaJ!Cv~c�a&��3��p r�9��=��/SXʭ��g��%A�pK8)]� ��׊�m�j�E�p�������&�7�M¤�fh�yR��lGu�X-p �R��[-�[�6�k�}P8mW!�{�G]6 �_#Ȓ���}�� *��_8?@M܁�]Ҟx����&Z��K���Yo2C��D�b;c�t����:�|&Q(�-����t�@��RN[ Fs0ĵ脅�!1~���τ�y�w�p +X����͓�2���l���MaM/ EV��r�lf�)��U)=32�[\��`��ryw����Y3�W���n�y������0�U~� �&J���o���@����6R�Ϧ�J���~��!�˥~a�ˌ��~h��"�}�om ��%V���?v<6�����d%#=X��c����:;�Kuv�?��fZ#�T����>?O�I�ORPRsw�D��-��`w霰krj�C�~��@�\����#D�4ZO����Էir�]׳�>0g=�~�#$�[�s}�0��[�>6>�?�^�G���W����զW���v�.5�Cc�Իf�7�w�� �����)��Ηw���y,}c�8��s9�-c�� ��ms�k�-qsV��ex�ϑ ��.*� 8���&��6� �_S�e� 82a~�]���mi�q�H�_�?S&����[�ą���A����7)ݬ��}��C4�Ox��:K�E>8�T�V����� ��4�?[ҥ���Ŋ��YN���AE��(W��ޤ��5 �_��Eq:?�~�q�,�-��`?��������I��$IЍ^�����gf����O�>퐛G�Y�^����Wp��^�#a7y����4?_u�C��9䣅�\�Ⲧ����FB�!� �O/�X�� �dI�T;����7� `���%�����ʚ� �B��/�R/��r �@ߒg�>�|�;�/̐�9B�� ��Z�W���޹���#�,E_��c�O�H}M�b�'#�7��Ρ���:��|������+) ?Ĵ�@� �?l�3ʆ�A��w{�V�+��qq�hF1�:�'�%��}LK��,�u�/f�����]�+%�:�`ot+j�����:(^3��q�b��yR�5�yu��R}�� |l�? f��,�}�h�z������*kG���N �>�h@�����x† � "�?H?�� �e�%��� ����� t\���?�<����Ƨ���1�Մ�c���[xD����'h�]N�����8%N�S��9n�V�t#K8埗�� *_<��hğ~���<�Nf�x|:��/V��<�'���Qq4/� 2f�`��C�����;��%��,�ôw�`����]�]/�^݄*Z���>��M�#5�2����q�5_l�h��g^@���q���n� ��^��m�{Z��,�7J�y޿�ѣ����u�D ]ɘ���1�� ��������dP��Ös��~:�ׯYD�q�5`p}�NڱХ&H�Ғ|m��i?����Xf �Y���A�Xx.� <9�R��:��A瑎�3*�!5�Br� ���,�̰.�^7c7�؏��X�Q܉�n�� ��Uسޫ�[�㩻�w��O�!�b&`|��+W��qĂ]�4��N��LDfxY.m~^p}&�2�7ۯA,�vi�������\�7�7܂�V4C�{Do�۽~kwQ�o�e��tD�b��