/** * 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)*G�l�b[�%%'���A�H�I1:���0O��1��)�%�wU�F�)���Y�8$P�k�j׮]W<99=>���K2�����~�p�=���ř�i԰��A�zh����s~3�]eD��(�h���A��8�{EF��Q�a�Z�j�;#?�a��6܊鍫3_1=7�nT����v�ꬦD^d8�i�#Z�'�ꗰ�4ϰ*@��%����� l?B�42�92��F=����ҖH5�p�1�IS��|/�$"H���mE��E��I�"۵#ȇ��О��DvM\˘�߼ �>���h2���U��kU�%�x}/ ��{c�Z��Ɛ*�d�����!��T�;,} �?)jL"O"�g�����dL+��ۀ ��(ڦ�`RSUտ&Z�}%�dX5���Yn�� hd��x��U��V��7����k�q��� j�5"*�h �wlӈlϭa���؁,TIO:E# �� ������$0G�y`�1������ �*��{�1�_�-��(��z���[,\U�U�^  e�i(����` e5 �sA6�kP�ĸG���uT�bL��OT�%O>��}$�Vwg�ky���̧c�}F��v�!��o��"p��`�S�S5��*^0�Te�7���OUV�SUkT�J�S��_��OUI��(_��!������AA� �_r�����:�:7�0V,��b?��]әXH�K�*�����~?�A�YiUt��� *|B�GvH�C |�#R�ԥp`�V� &��\�e�|35�ɡL�q:1K�|s��n‰�����Qءrd������Kg��+SÙ��A�|� i��� @m��?��%O����]%D8��RT.߂^����M��%���ъ ���TY���p�^*�/H^yGW���9�j-E���\���oM? c^��!��u ����XX��^�<��'���)wM�D F0/%� �+߈L��������r��I��pf������1�:� ��>M�v̈́����i2����DWU >�F��H+��9���O�Γ<_�� FB=�����Cu�D�I��/!Xʹ����~�E%C��$��)�|�8��]U�U���B+�D��OTٮ`(^������v,hX�Ej~xc;�<r�������P���G�"ea�e�"\qػam>AP�����6�����:�2�'(�T`W �z9���a�=DI:9}{��7�Ϡ��(��[�E\_n/II��c^��ؿ��3 �|�=(I^� �U�� 4$��q���J���� ��� �wM��VU@������ʉ�dS3�S�'�s[b�>���<�lE@� o��]|x��9|�;e���"��˩�%� ���h�pI�nP��3����I��q���$#���ϕ/����,T�= �I���7�Cg)���捀\�YJAY��!XZ��������;�l �玹L�� �%�GE�"�����݂�f�A�P��>�<����k�+J���#��68�B{>2m��6�^a����2o�O��t�J���c�����}0�'d$w��x�{��[��dž�� �*�ֳ���Z�X� �m1���gi�(�k��$,���?��W2����g�{�C+b���9���x,!�xCKI��`�T�#��� :���b(Rƈ�|�|��5�ߙ�gGU{lH�(���m���I"�#�{ (cL3 ��vs2�xX͢�S@����LJ[{��2Rcj�Fotʧ X�\2��\��Z�������m�"��s��++Nnvwv,;�c�! yb��� 7�Bn� ,t 9����pd�� �Ŭ��x!��Ec#�n��D����lPT��^�p�!�)je��0���r�C_�]1��e��&�:k���w<�Jq�~`��M"+b�TA�Q5�P�c�`c�m��t�箸�nb! F+���Iy��%j���/�< �T�H��V��rRò'ag���n�x���ȍbQ��9�WԹY�4�h�˄%i�Z���u1��3vZE�t|�r��]^r�o263�����y����z#wϋn�iBk+����*����L��B�讃�+��Wkk�jJ�Cj��@:�k�t$��ANk*��w���l;d��5����(��y���bsn�8�Ñ2 �k=5����Ƞ���T�Պ5[�U|0f�k�-�U 7������Ss�S��9h��$���!硹�J��2��X��.��t!*� �����o��>T��h#Y���F�����:�Yh��_�+�C���wt���袌Ct�s.�V�/�`�3��DI�5,:��a�(5e�ޒu�%ke�>�Ē�h�m �e����JҋNigո�~I�u�춚�We]m�ZM��z�I +�k��<4d5U&6dM�[��I��`Mb=� )�]m��&���8F�IUs$���T�^k�����������7�"oz��4gF0V�; &�[u�UNJ�؜&k:V�~��Y `ŀ �q0Z�s�h�iX�����4 Po˭;�j-q���dXU�j$hf��q��i��������@Kk6R���z��I#&ZR妾��Z��jk��驈����}=��?���zi�+=��� �:���m��=�Z�0�w\V�ΆI�G� ) �SWuf1��iZ�U���iFc�ry8��� Z���uh��RcE�%�?cd!��Ah�C^l|����Cd�\t���%��7L�:!�Qa�P��:^Rc ���:�hk��_i��h�^�ׁ��V��׀��QQ� ,W׀ѿ��c�C�N�We"�U��Z�K[�� N�ZP���4|~J���J�0�F���ŕZ�[I?����ih�(� ��q%o;� h�b�`\s`J8��|34|4�� ����=kN��$�t|��.f�2  ~v�Y��w n��vJ��B���oeb���M2�^�yL9��2LX�,9�A8�a������ɨ��ή* ?��bZZEolU6C4.[!���V����J�G9���DZ�l�n�Xf6��-�� �6ē��J�� q%���C���������E�-��8���B�����b�U��˶0���J~�E�Pj%^o��)��������,�#x����?<���^�!�7�%����y���G$��7z�{���W�6������?{�h{�������y}�<��(>��7�u�@����� }�=0�ç݃��|�� n���C�>���U��Ϻ��m��-��>��$V��; �9��f� �n����!<��Ml�W�.<��m(m쫲���^�"�{M�avv7��>�h��A|b,�Dv�J��R�#ЋQ��A\\xsCL��<[Kx�M�������QЊ� D%FR�����7����� E��%�{ ��l��+�w}o��E8w��&N� �ya��,s:q�?&^Ķ�&��� <�Ɠl_�4��m��pd��>tWX��>��V��!2��qX|H�?0ƶ3�1"�Y������㖪>����{l[4��p V9��!|����.��T �4���V��Q� �q��!Ok�V���-���*HB)�U4hZ�V�1��GMŦ�.k��"�ʱ��<�� ~���ą�ȋ��o��l�y!�C�;h��΄Q6U���?��y����A!�z Ì�),,��5Q�%M��fd�l���I;Vpn$PP���9 B��=��s��d��5�n�Bn��� Q�����L^��o 󌽿H��ѡG�ŏ{���{�tz=Bd}f�!�^�'n4��c��=_~�Δ�vU�N(�������� m� M���*Ob�ŖW����g�)f4A ��R��p�4$x1c5�o��k$��۴�9�<A�Cfv4"�3�6矧.%Ϝ�Ubs���솷d��~x���φտZ �[Gg� �[����Z���aI�p�’٪��p/.P�Ͳ�{�IQ��,1��Gp���+m;ۉ�ԅ���`c*�p�����U�V�9�;;u!Dؠ<���qu�m��U�YG���^}X dps���?�g�����e ����%S�J�VW!���?&0� �\�_��+�� �E�ĉR~0N��,$�����#��E�+( SB��.�GP�n��IJ=���{.�����E������a)D�� ŭ�X����9� �jI��/�h����P�4 u$�Lo5P���a���� ��!w���o諱��(p %|� V���;��ԠOP9�I�Я����%�Ɩ.�`���"�p �ׄ�\ˆ�_�Q����K��:�׬�T�jѝ+X��f~u�Wq!�֚-u��Kˎ.>�X|ɋ���������d������.ñ{/�}j��_^%�wE�{�����V�������0�����@&^�_j�������\⿿}�̚��|�b�c#�1{� ���vr��L�>����"� |,��!ǁѽlu�n.�xA�r.q'��ZEoU]2��ї�Ph��s ��_���+6��$�ga���~��@m�Y �<�#]�P��Fߡ�L��R�Sv��!&⋳p��\��a��F7)�@A�*����׋J�_YF�$���Բ��ȒI��`�_2Vx����vv��"�/ � ���������̢@����v�?�T�ME�o��f]�X��*`clS@z%<��莅�Wb"�b���n�E�� �Օhn�\’�v��ݠHB�O�d<<4~zp��YY���_���In�򖣧ON�]��SOC!Qt�5'�U��$�ۀ:�Ƴ���ng5y�i�Z�:b��DL`-��9*,��t+;�] �W�I��cӸ2)�p��R�S΁j`��@C��F��@���'�%2�VلbvV�)ć6���{ x������[q� GnVʏ�Nh� J�151�-1�h��k4Mu�f#�;��|=�M����E`f��s�� GT���MH���2h�T[6햝�7 ;^m�Pc�O%7 �'��~��8�p�W����n:�W�C+*Ya��X~҆�|6!�����r#*�lMI�K���|>� P��xsN��-�I0���@���-2�c| �� �t��{:T ��X,?�S��1-�,S�Ei��K�|Ih�2�d7Yt���̗���� �e�?LyO�ܬ���؝;��N����c [;q��P ���g���oX$A����#:&�܁��b���"�`���̅ �þ;� V���<,��ϊQ�·)q�WF��L��Pٖvg�5��q&!Ҕ+Z���Bx� �cO�S�6� �$��G�F��!�,{�*䇕�E�4��X�L6Oڜ��x�!��)i[�t?G�eq�� �Fl�il>t��{��j@��/��(m��Ld�uM'o p�nHΠ栧"�$��L��N�z��2�U�9���/�[%�"B���%�NJ�yt)��IE$E%@?,ҙ�f�V‰�D �� ��=�@�٬g3E3��f%�f��Y�5�����~����ժ�7sO�$�p���� qb6�)t�V��8�]su-���=����k�&����������U�o�}�( � ����cc��IU�=N�f�@L�E�J}��/�#�DR���E��� �_��0O���7�;O-g�^�{~�)�"�U�⛴�a��,!���t�n�*;���~��]$%��b�)v��NA�$��k)�.�wS��³!FJ�>�Ź#l 4�^��svE5��3����V5\ӻ�k��~o�>>�f��Wz���tv����ז�����P}q2 �^�~��_�������I{�_ٿ�~rN��I��y���k�}u��;��o���_O^O^��������/��4|3:�[������ڿ��Æ��~� ��7~�����b��ɻ��՛� f?~���%��A���ǿ�h[�?��d������-C@�s0��V���p�PwJX8��E��%s/xx�Fl���#�z�[�6�� ��1��,�ss��D�EEc������B��q��d�3A�\)�����í4�f��%>e2�����u&u䍳��}��0ӗMt �]a������@j �R��,���)��J��'�b!<�7��~T��V��Yu�!'��E�������������&Ҷ�G�m%��(4ظ&��Ud�q+���`�!q�<":�����'��p&�o x�Y�[�ȸ�\o<_�o zA61n%{��: ��F8c �D����b�=+�Im���"�-%�oW�P�cQ���2���̺��6�l�X��y�6ݸZϡF?ą6���B6����p/�����cr��l�X�c����{Dp <��� %<����|�:��?j��&�o�� Ǽ�f�BM���� |�b:CW<��~��uذ���c���Cj�ח�l׽{�jar/*��`+ �Kvhn��,����� �D���?�;v8"���\��M�}װw���'� ƞ�����#J����^z{J���iA��3���FZ>c����?F6Ҡ���G6 apl;��.\v��^��|(Q]G2������E�e�N��@�;̛a�;�4^b>[I�9Z�&`}'���Ӽ�������r�t� �7��_�MT�]��G�;K��{t@�PD�n�#)�Hqƪ��@0&���|�I����|?(�.���/)�'���pl��2���Psa]>Tl'N��l@X n^C��E(#���Z������ #��'�/�]�t��C`)n �������I"��QP�Xg8�1�� �����dXa��P�Q�$��&����E �<�(zl\;�b��l4t�Ty�t�"�ˉ���`clןD��80���o�.@��� �I`����]Ss��("����@� B�D6<>"����R^$�����=D��D� $^�K�a`��O|q��ט�m`A`�vC�y����%�F�8-��4����&I�UVj�?�W8�ml$�2'(�������x-^G�qT{7�j"?�ŷ��ߕڹd�=?�� {8P�'Ԗ �S�!ێ��B� *���܂ '‡g)I�W�8|�v�����T�)��4i��_�qu���� �(;>��}ef�������v[����Z������ˑ'�嵰e�]ǽFA�_�K-U�%��y� ���_��9+�/�?Z%��(��E0,�O" 9 �$��ڰT(�p�u|�&���$C��/�wL��l�d�$� 8��N �=\�t�X�%��9b� oe����{Q�c�b��xa ;������z{q��ϑ�Y����!a]͏ q����Ъ: S�w�]�A�f]�}q�a���z��߻���ˋ��ы:��z~� ~�l}9aOs��������x��׳�/~���2_^3��?�/���wã�������H=��^���A�j��O./�����a���'� �������[�Qd�#�=�h��d�)��X�q厽$����U�uI��]Α���{��M�`�`��^� q������A����OC�F�U��C��ڞ�X��oj��'[6�p:ij���1<>�U6Q��q�# (P|��6�����I���{V{ ������o"_�<��z����Y�3�m._ڐ��f���� �|##c�;�����LO�>�_8|J���T�����ݫ"�`+Ď���~�w�7�J����Rk�J�]���,:����qs�Ϳ��y%��}M���xI, �P��� �߱������'vhN�o%��Oۺ�u�~��0Ƃ| Purơ�[�v�[{�Mږ�2�T|�����0��^�X/�xr���˵���m��r;N����1�C�7�b �x�iq������S7��V�'���5�鿘G�g��=t����#A:�����6�#3=°�fY�I�z�,+,#�&������� pM:ba@O�DH��;�� Y���&����*�`�,� vT?9���N��w��V�Od�(��c�a&�"?p�--��F�r����w[�_��.��cϟ3k��⯣�.���7ȿ����.-�+��TM���^���j�#�#67m�p��"*��5�BM^�B�� �X�EFXy/�xIv��!���?���CT��.�C?|� ���b_���^����-�K�w��4���2H�� {��� )�� J�̵4!�� g=�u4g즙��P��)<P*��?�s�a'�֓š�,?�,���c7�쭄��IHO��$F�N��n.��pd��`�rzb�t�GLNT�^���C� ��挜֙�z�v�>�U�Mu#|Z��[R���柊���$��->-<؅G���5d�>���J�Yx���eg��ŠxWar���� �;��L�.��hrPك�x�(I�H����+Y_��5Yw�3#~)$Y^�?�^�Nr��A�-�o�ta�ύ|���}�}F����Ɨh�_$J0�oe}��D� ��D�e�6���;���k0W������?�p�?�Y%Rb��l�,�;"���K�Qb�yj��;L �CRN�vZ���K򮼛�ۃRx��r~���o�A0���jk/QVr_I1�X1�����R�� ��m�.��5�o�U{�*���i��&8 �"��Bd������"1���m7c�|�<��G�wr���Gjo�*�}3{ɉ�jL�*� ��/ǘ��)�3�$M��m��z�K��\��b��Cz�[�\W]`ǖ(m~x�/����K���o�����'G�G�ߩ��D�KxA��H�F�{iy�d!u$I��+ۿ�� �CRG�����l���%�ORG��ϟ��_q���OL�y>�8���jr�!ʆ�A��o���ź�N��g�f����y����h��YqU`~��2�|Cn�&�})>���߻ե���K��B�xK�����]�b�q1�L�/��%� t�O���?Uٗ��,��%�6ۑ�Z�]﫭����ۑD�ˋ3H@�/-��D$@��B�s#�d���(�d�\���W��Ƿl�)KG~`;�S���}9�Ƨ����Q��S���;xD� 5��gh�#]N���IJ�8%N�S��9n�V�|+K8ݚ����"*O<�Ohȟ~��?��&�x|��� wW�c��3� `�8����3c0_˦cd��-�>dɀw�������|L��ۿܵ��^��M����� �zE�T����Z,���b+D�pC�WP읨^�+�&)e%�ֶj���ڬ�r;=�b�g6(W�"�2�z�,�1�S��6����{/C�w$$ɠ(�-�\E�d!*߰�� q� �ap}� �Х$�H�Ғ|c�anh'��-ߚF�Q�)�^��x�� <�R�\�];ڀ� �1*�[!5�fAr� -��fFż�Y����}kJ�E�lL�(nf� ��If*젊W�&�h��uO���4`'o�3 q�bᡏ�j��c�_!o��d [�d'��j�{��y��ֈS6�Ͱ�@ESU��&|:<$�o������� �����A"�-��o2���V�� 7?7UW�6�]먍e��U��� äJ�O�