/** * 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�HQٲd;�r,)�ٶ��$,@P�h���y:o��}�|ɩ�n�H�"%%3s�( tW׭�����r|rt����d�݃�}�"�� {���S Өi���(����U��}v3v˄��/�$cZ��0�&T���!�α됺�i�5ћ�+� ê'�no��"dd@ck��kl�V�H��*-p"�%�aVR2]�Aό�D�Y�5��u,3v|�F�7�c�P%=�+����'�s�O�F��������W�����3��W0v��PѦZ��_��2��� �f4k�^�k���V���+�����Y��{ ����8���bz׾�Wf� j_��'���?��k�Sdz��z1 �����8v�aDz�F�=]�#��T�T�ԩ��O5�R�OP�!�Tc�?������O��q�6>�$Y��xCx�����6�~����P�T��H���8X��������,wb#�/K`�% � g�� {-����mT������ ��F�� �GC��F�>L< M���^��� �/G2�&�Ī��M�X^ܻ�&��3�Q�ʱ3�'st*��c@\U�LwBO��m7�QhNc?���տ�+�����;5Bo7t�J\�ނ^����M����Q�Q�Ԋ+����nz`/*���+�ʪ�R�gP����j� �\�����ah�*TOX����j����*��c<ɏ�M��xz$V)����+��z#2i�� ?Ɵo���'������h ,J��Pꈂ�F�4�w�|�O���&�����2� ��S�1C�@ #CS�8*$��x�R��*�d�*�� �#,h�aK����Y_��� ������*����"� P�U�}��$�*�<=��i�n@�t�D�i��/!͵����~��S��$��)�|�8�]U��Qh�@�*(<�MvT �U��g�׆�u[����?v"PnŇ06x���N���$9�}�-RV�Y�Tኣ� k��ʀ�����E��D�ɔy?A��G5m����Ɖb�!*����#�xx��@�EY5�r絀,���ziJ�}���F����a�� �˜AE��_��J�DO�!ɛ��4̥�i��+��sߴ�Ʈ���j�S����O�uN�O���m�1��ђ���Rt������!����ˠ_@[�f�?�߂�A�雁���˭T�� ��\/U�IFr/��/��U��,T�= �IV��7�Cg!���捀\�Y*aU���VZ��������{�;64~�s�zy�*^���DAP1��{�U!�*�<��;x���Wh�+*���#��58�B{>rmP�]�4���By�7�'`�h�e%��[�1˟�]�>ߓ2 ��;@o<�=��-��#�u��u�o�y@�vA�Y,R�Ō���?����z�P�����n^�����e��U����sp S�XA8񆖒BU�2�_��G��[t�Uy�P��7���k�3���v��=Q������D�F0|�PƘ*V%c��f]X�G�' T@�uU��í�F�1���:��c.cp�a�}-gp�����'A�h c��L�'7�[[��9�����R��K�+����t�f�Q���o]*���p��I$cE���>� ��!cbl̸�qX��,7�u,d�����ޟı�]\��n,������`����ԺQo׭.7!%4mgu��/���k���(6��;���IeA�[��B���@�X%,IW��z�������n4��6�%�����l$a2'H+y��4=d��Z*�( 0��0�V3 ��UE�~��!�f�]�P�Ҩ�WՕF��k�;� 2VHθ���R���Vmo%�v�^Mó1�+PQP-�Tc�0���p�D#e��zj����<�|:rbP)V+�l)L`�T ����k��r�+�ʱ���_yj j�r8w�ןD�X�7�<����5W��P�X��Eл� DeZ�v߶��U��a�����H^)����]j�k�<��ګ�%u¡�I���o�t^�!: �9p+����͙aZ��כ6��oVZ��hˆі�*ўabEo6�]U�kڳ�R���h�ո�~E7 ��]-%�Ɇ�+�u�N�%&�,1�Uj0��Д�L �ؔuM$n� '�i�5���s�� �-7Z��.�e�Uaΐ�XQ F}W�g6���4d}�yy��]�95ñ��Y8�$�n�V|��tY7������k+T�HҀ�F��G+I� �=�7M�]�}��@M�%���� �*Ck�����;��Sc�9����b�ff��h¿*i&�AK��2ֶQ{]�!b]�u#qo���gd�[�'v���E��JߢwxF��hgtw � =G�.k�ΆI]�G� )�VS� f1��kz�U�n�iFc��x8��� Z5�R� h�:�RsI���?cd!��Ch�C^l|�� ���Bd�Zt��5��(0-�:!��`��6!/�3�V{H@��M�W�+ Za��*�6����� �]i�Z�����0�7�@u�� ���L�?՘�Ť�Mi���.�hj%��J�wd���.� �j�J�X\�'8���C��)`������ ywP�3ѐVT'�S����՛����x� f:v���32��&��[�v>?�i�X��F� �cp �S."�A|-۹�ޤ��E�nj|+ Ä���ӡā������kiE���ʋ����1-���Fs��9�IYudF|���[1"&WfXY>ʩ�'8���fMt��J0�AК�l �t��&��W5��+�/�U�������4x$~/�h���ƚ��-��Ƙ�-��l\��Y����)ڹRK��x#��H F���'�nf��<�����!D�����/y��=�C�=��<"ᵽуh��G=�*7�\6�M���E[��=��]���� 乗G�y�@�����5|�=������>�T��Np}vZ��]����|�}Mm#_uoQ��Q�&��7ݱ`��ie�0�XBw�ňu�d �A,�C`���lu�a nBim_�_|xL�JЗ���k������eK�ci<0��� ����L��^�j� ����bZ���Zƒ�dhJhW D����V�n� * ��l� �ؿɶ��`�_o(�-1�!/Xf;��p��\ ��{c�.ù��5q�H�O��o�"���m��l+i�?����m<��5��]os�mF#��衻�<����=~ܐD���㈈�ہ9v�Y���� M{f�5��S��۽ǶE�҉�`�S��˸k��֖j�Gl��֖�$hx@8Nb�yZo����n)\n/P9@JᮢAk�����->�\φY��^�����O��<� m�ŗ�{Eq�*yG'R"�W"h���b�6E�f�Sq �'���b˫X���s�s�!���e�`�x<��������5 윁c9��>� �%S'��)P������oM�*�9]cv�[2Yj?����g��_��խ�3���%�����`-!ևG����ca�l5�HV����VUƽˤ,SoU˘_ �#�XS⥶���X�\O֘�1�o��ތ͌�n�*d�Ȝ߭����� lP���yGȸ����䲂̬���B�=��2����� γ�m�z�6C�^�c�%S�J�V� ���ڗ�&0�S�v�ׯ� u�������q��I�����A]'z���H�qeaJ�:�e����M�(�؎�{;c�cWs0����r�1,�h��#����U�"��}�u.v�:���Ї�a`��(���G�c�_���&��L�o|�P�P/X󭱧o'��c�a��x��c�L���4>�0jU~� d�/��߾I%e�t��AB>[1�ñ���%�xr3V�"~Mm`^!^>��z�P�^ֹpߖ=�0wᖸ�I]5�j�K��R\c�j�02���E��dc�K"q^F�Qt��z�F��@��e�2��� �g�]j��.��DaWj��a?� =��ʃ�F�^����4���M�������5d�N�p�(jiFO) ԫy�o&�ca�$_Wt!�Zh5��`<����0d׽���X�����W(5|N�O�c�n��-Es�����ӧ���ER�|J'�ڡ��`����^"�:����B&�!����R<+itIn=u �D��rԜV9��o�L̼��Ϻ۷�*�c* �r!�&Nn$x� ����CepTX!��u,\�����g�2)���+%�`�0 ��� ��F��͔5�C�u�O�K d���)�����W�dd$��&�,邍� �@K�XpJ&OE�b"�Y���b1�"�\e4�ɮ)��J}ϝ-���]�Q��0=az���=c�Xl�rv[�>H���1l�$}�v2'-� ß7�2��a���#Ď[��p�Utf�����eYV0:*e��\7��DQ�ӧ���Ok'��IQr�'��_�.�g��_��P���cS�� ~�S���J�,:=��l���c+8�M��X���b?+RD- ߦ$�BR��V8�#e��6�U�U�T�[��i2�H��R.�X1 g���2Ǟx�� l" �I&������C("���U���Ob�����r�0t��1�z9������A=�����vKc�k sQ�_ \�J. D�Ѕ�K����R)��H�J�~X�3��<��S=�"G����e�ʧө�d3E3��f%�f��Y1t�m��^��������m_ I��$�3� R��<0l�S���l�q�/���Z�}%��;��'%�|��x�-�E�q�g� �o�t^0 �S�W�n|���nb&5Q�8��1]���+��ڿ���KI9�2C�QJZ&� |��C��� �B���Io��Z�/:��w�3d����+��'�P,*�����4:-��p�$�) �Ji�j <���m�\�S.�_ĩ�]�RG�8���7�s}�$D��f�8�)|d�� +sQۋ����!���1���p�+�!“�h�Z��*��H4>�1�:�����ߎ���"�B]G��F�Q�E|�{c�]�?s�*�����L���8]��ڂ~`��_;8����j�-xl^��?�-ʍw��0��7�=�Q�@�#�1�X"\W�WP�@1�[����n݆7��)�(F�ba�M�gݏ�n[6[�S���+t�?��7�YQ|̱XI�!5��s^���=E57�� �q|0��$��0 �f�Tcj��O"%��]'�� Gv�M`�&�g:.I�RE�`cߋ[])����@��#�#��޹�x)��t _�%�{#���b�n���t�����X�i�1��0.�A3�"q' �"HO�-*��+u�L�:�F��)Z��A����MpY����p^hLHF��(���<�|� }�*�7�050��^��8RpK��x̵�����,��<*�Ж�c�Z����ll$�ݿ���/Z���j^Qb&?�U`�ͭ&3�F[Xs�K��Z�Szg8 S�JO���P����^A��� �^��~ L�� �y��x/f�Dl�����|N��z����3�Z��`���}��D���IM0k—���w!� �,_4�I�k��?K�,�R��).Ա�S�D�v������g�[�p� [ ��,���wI�X�>T�]2�}v� E��0�a໎�3�xJ5V������O��H��0b pɾ�b�'�l�o`��xy~8xw�}��V,N��MqB��� �z� �枸��E��A���+r=v��o���=��������4�f @(� ��kŋ�J�O����d͐����X��j���r�qhZ��"�Rcӎ.P��u�B�ͫ�}{��ZZ�ƶh0� ��l��~�n���mu�%x�3pЬs��;0�����|��BN�l�_M���0 c�����W�ޫ�i�~ܡ o�͹���k\] j�/H��9\1�0�G�,��ys�ż��3�"拕�I���6p�8`>�K�L���c/�d����.Al���r�"��q�mң�t8�צq �4�-��9���X�ᘘl�z��"�?b(�7��<0�q D��-���W��`X���ă*����A��I2 BC�Rp�)���0@讂$jRK{y�i1�z@Sw�`?+��� K� �����RJ�K_��� JDAi��L:��8$cw�a�A���kNՒع��Z� hp4����y�Ro�k���n6������XA�$�v�k��x�$f�'!g?y�6�I���WO w~��V��@��Nz����^i{�L̐�"������!//$/\ �Z"�6����}�<�os �kJ�C蜼,����c�<�/�a�\�xG�0I ��R �1��I�`#�9A�(h&olA\<'c_�*8z�ң�1�Ry�i,�3eG�ܳ������xG���1.?N�����N�9"M��8.���\8>L�_�C�{wz>zy><<|��ן���×��/����pz�=<��<�� _�|z�����}1���k������^���fx�?�-�N�������>���^����2��a8�z�}2 �� n���^�3�Mk�;H����?��lɃ=.�n�F߅͵ڳ.I���\�=R˷�τ1�%����Yk _� ���S��]��i*Јt�K0��+a��e�Ŧ�0;-�a����xTR~V?��g�Ʀ����d���ЕC�/�k���GR��4v��_6��?]W�7�?�<��z����Y���� _�M��#���s�|"��;����@N��;�Z8xB����v��!�A�[OEF��S��{�(�&o�•i�-��6��n�!��������X�z35�Z} M��>�'I��GP����{�Xbth���c'�&짍�󧻆�w�^��4ǂ|2I�d�y�&���?� 'Q�����d������� ��a�¶�/lVc���^��m��������΃̅ ��%���2�\�%ȱ��v����La9�lk��?��<8)]�� �Ŧ%��81DN9yˡV.T돻�B�pG��O��ך��[�NW �9�`��Zc;�&rm�g�J��@��ˆ��Y��[�w��A%�� {詉���K��^՚�`B�#��sɜ:�Mf��� �SL�cg��?Xg�+�$ %C�E���N�bA�i��h���0�'q"$Ɵ���<��6Na �b�y�T;g��_gKԻ�n ~x�&����7!�0L��e'���3#c������ ƌ��w���̘5C�x ���^�w�̫���W p�h��[NP5Q�E+K���������ҽ&󨤃�|�3y��hS?�d��a����%��'����DKK�Q]�xl���?$��U��&Ky��{�_#�3w�������L+$�� U���\'7��/)(��[d"v��z��cN��0r��j'Wx�T.C�h���N�'��XZ~��4��.��Y ����x��1�Νܹ>�������%��F��!鐏���2�뢃'*Sjٵ�3���}�����E|�oI�{[�*?�o�����t��T�o��ה��|~z�N(q}c�it���s$s�x�Ղ���:�+�S/ ���)@�OE�͠$=ߌ?#�J��%]��*]�Ⱥ���Æ 9���c�-�2vқؽ �*(~����dn���;���=�3z\L� ���"UB��|+�[Oٝ�~x��/ Wq,ܼ�/D�Z��F�'���p��1ɪ� �i�Ј����*t�/�GI�fE�-g�d�N�����m���=`���]y7w�2�<ƭ�|���o�Z@0� ��kk'UVz�H9�D1����c��eO��6IvC�V�➋C'�H��CnS%f�Wx�r�_�}�{����鶛�i����#��9>y{�#�7\�Ⲙ���r-!Rd�g��c,X��s��M����z���\����Cv[[�\��7�)~i��x�/���K۵�����GLJg��F�+3$}��������5� l���q�B�H�,E�Np��A�'��&K1DCF�� �� ����j:�? ���< ������q�����zB� ��(=ޮ��� FD8=W���Q��gIƟ~�ba�Ȓ����K���� msG�Iɩ���ݍ�`�^�nZ�K��4^�B�H��fb~1�/pN�#}B�6���ƾ�d��,��َd�����n����IԻ8?����v�InB���(�:7NFK���� y�h?�o��S���q�;��0�(�r�O5��) b6��'�)�w���cj�����G.��&'lj�IqJ����s����V�p�5/��ET�x8�Ј?�Bm/y>MB��*t��)���<�����Qq4/� 2f�`��C����[�;|Ȓ ��!K�1�=����k��5«�PI+�/��݈<�Q�ˡ�\,�S��bKD�q�� ��=Q�W^K�R� �N/�m����Z�Q/��H��y>�:�\i���$j��H� dN�fڨw�l޽�Dޑ�$��\�\pu�9��z�"�.ą7����;��B��T -JK�Mc\�������zk�1�Cf��B{i�c� *��Jժ�xN��':�cT��Bj�ς�xAZ��͍�yU�.�A��֕؏��X�Q������ ��U�~ ���m���=���(�W��iȎ�@g@�0������'G�_%o�zd [��'��j�k��E��ʇ6�Ͱ�@E�Z5��G�txD&xY.+]/87�f��7 A;�4D��oq�d�W�-���W E�%z��kcwQ������^�>�