/** * 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�� ����������ܳ�+��4w������ �Y�C� ��ȏ�����̼T��9� (��f8�;Hj+S���j"�+Q�y�K��$��?x��iur�p�P%���E�Rl@����Do�?i5VQ!u�;�!#c[�^w;��0F���'P}�a}1����B]zfL%_�c3\�2c��a}w9s! U2��� �K��.g�`:�)y���]�R[Z߄�ސ� ��� �/ڔCK�� Y��R�, nh]�7T��D����(��0�J�-��=����rz�7���2n|6���c4�%�}88�?��@�ml_8��_�g����c�ID��Z�= ]i 8���؈� �'�G��C��� l�mUS�]�k|lH� @y5�&��O� 2l��GO��C�Sip-��a� ����#:adzܹ�t?G,�aP��(/����4vԮjH77���G�d�Dd츔�_tHʄz4l���ܳАk��կ�͐�r$��$�X5Z���+���y�>��Fq4�r���ɜ��G/�! ���;�G�Z�f7�Qh�c?�����k�����[5B_8q�W��^��XS$ws��j@Y������4Y�����^T�+���˫CH�@��b��\���p��C�F� ��u ���Vm���v�<Ɠ�P��wC�C��*#���� �_�L:��z��y����A��%�]s" DAD#}�۽��������j�sC�l��1���;�� ڻgU�|��|4���;`�Z�G��>pTH�¥ر�$n�R]6�!��_�8$Ö�� h+�!�}�?��^ i7u��Lឃ������$�T1"JM#M��}�. �I[4@?|ak�}ԯ���0��2� �LO1�sDZ���껱�����?�dGŠ\�H�z���qmhX7Uj~�3'��|w������H����"ea�dO�8^�6O� �H��^\Z4�_BAT�L�� *pTӶ_��\��(��&�9��k��g��5�^�U� w^ �b�/o��d�2��(�V�&I����$�ܪ4L����lD�\��v?�����Y⻎��i�Y@��;�zj+��\��Dsnj��GА�祭�V�J5����O��/a}G�w�X��b=S��Q� �Iߍ��?f]n��� J�pT��99Ƚ|R?��W ��PI�r$Y�$_#��P��7rU�*d��u��bh�n� ��������}o�e�mتyC*:gt!E@Ā��5W�:�E�\ ���j<�^�Q�����>��z�� R��k�j�膕�O��˼9?#Dӭ*�5�j�Y~ w}���� �Q��z��#�B|<0]wdZ_�m=��,�5�E*���V3���JD�^k%a��?� n^�����e��U����Sp ⱆp� -%���e��Z�����9��Z�En�������Ĥ��έ���I|G |�����f3M������n���&�%;;�_�l$a2'H+y��4=a��Z*��_+ 0�Ӆ0�V3 ��UE����!�f�� ��4��h�j*�i6Z�d�2��q 9����N�����o�ӽ�2 �5�S c]�Νh�LB�Z��Ѩg��S'�b�b�V��K���=��VÝ;玭���cklP�Vùsh��<��� ��_&V����4�Fˋ�w@�ʴ�ݑm�ګ�/��U�m$��D��}����Z�;�u�M��N8t0A���N�2N�Y@Ϲ�[�TD�m� �5�ٶ�D'#�֑�VW6���׉�kz�-�tHlՉ�iO�KI�5��Ϋq9��n@�=-%�Ɇ֓��v+� �@���*5mxh�Z�Ll˺&7b��̴���j�9RB�֕[�wq�2Ӫ0���XQ F�'��3��A!-Y�o#o���4/�p�0w�g+ v[@����9]� ��~�y `ŀ ZI0�jq��$iX���{ih����5����no2�� �tr�8Go5ZN�u����J ��wڙQ@Z� �ꤝ-ir�X�F�y�e ������>:�od�;�'z�Zo#�|�o�[���b�3�=��'C��������0����$E�j��,F7r�@o��֍[�h���WѐA�F?�߂��-���^�A�3�@b�&��K�0���gh���j0D6�U@� X�X�ӂ�� � j���2�&�tW��D_���|����j��HSm�V����j� �+�g��߄jձ�!P'̃k2�T�\�Ii��$��]���U�n-+ � �\Uv)eW�U���J3��-�d����i��(X! �Wq%oSҚ�D`\W��2v�e�zbh$0�����]���)a�NG���{S��_�E�X��.!+���-X�Ni�P���$�Ll�~��9@3� �#KDN�b�g^T�'#��Erj�.��� �<Ǵ������&eթ� �oň���am�(���|�8�A͚���*0�AК�l�t��&��W5��+���U�������4x$~'�h��HcM�bKu�1�r�e���60���R~7E[*�/�7BʋT`�m�<�u�0 ���>D���!r�׸��|�}(l�a�C�^~� ���E�>��U��纷in���/��^���n�}|^_ Ͻ<�ϻ��}������uM�v�w�iw�r?_v�����к��sUm��jj��;�����3�����lN+s���� �k/F�c�k�bi��e� �cpJk�����C�W����n_����ݎ���Z���+��"ý�.�[J3Yjxz �U6�� cn�i��gk �"����Q\5��"� Zɺ���$H*�u�lb�:�R����P�/[b�B^��vp��Y� |�w�xY�s��j�t��2/�7ސEN���܏�V�T:��g�x��kjgw��a�M����� K��e�r��aDf�+"�����q�������oi�㠫iOk����-�_�hVy����2nۻ����i�ۭ���( ΒXg@7��Q��[ �� T ��R��h�w��]��9�����ˋ�+�n��~+�e �sZ#/�v�9_�&D�BR�(}o"�0+�F�Ѵ�f��w�ɫ2�N �W�V�S�¢�^R�D�l�hN�ܖ�<\�A��F�)�X�0B��w�:KLW�Xs��T�mz@<)J��*%��(��:f�/R&;�t�Sr��<��s�>>]^M �>6�_OGs/���xTڞ�/?P���vU��)�D�D��ǻ����O�5T���#�-�b)/K��S�i4�0j������iD�0b�jߒ�H0�sƎ��W$� A.�p�)9�jW���G�ط�h�؜�m0��-�,�^�n�f�/W���1���’���Ab���ãQT�uܱ�`�i%+��j�S�q�2���;�*��ׂ�.֔x�m�;1�Z��Z%��� �������B������Z��� ���[x�Ww�6�\jP��u��-���:H ��������<���A�l3T�9;�Q2�?���$�~�����|*�.��M���@(��͹g�`���IYI���u�0�; ��VP�D��]&���-�E�s��!t�bg�{� F"�[�������b�7>b��V��L׼�% �?G��' wW@��%ԑ�3��@�I{�L>O�/Oи���J� �?��UG��c(@��*�Ľy§}���LK�@�t�7����6�pq��� (����p #:~=Fc�+C��ϑ��@�\���T�C�Uw�`�;л�F��FSo�K�_�N|�����^��e/�7�%��R�i�= Zu� ���Mj(~}������^���`O��Cw���8����-��x� �Ѻɯ��}������ש̬����{��g0 f�Cf5E�1��L�U���J���W�_ez��8<���.��%�?�]�%nF�C�T����%c��}) �q8�Fk�g0Z����������.��Z}F�YB�P�����6�ʄHg,৞9r�-|;��]µ�C�g�5Z8��X�`���/�*�XA�yߵ�Ϗk��\aF�4���Ժ���ҩ�ܐ�_9Vy���������¯ �-'���f���@����f�?�L�uE����NK[[ƃ*`ml�S@vA<{�蔅�� �x ��ħtOusv#`c)������gG�(���<9'�� �G�A��6�W2�5Y�x����Ic��f�S�PI],G͉a��nI��6���ll��dw�f[ŹM�@^nr��� �/��!�X%TG�E�mh�…���1Q��M}6�+�j�F�l��S�u�i����,��G��?_og3~M<���2�����6��i�@��e�SQ�`kJ��]�����IX�*����9! V.�bL>���W�dj$�J�� �t�F}T �%X,B%��C19�$W�Ui�� �|a�T�2�5E]��W �ir�f4�?LEO�ޯ�iO��[���V���!2�����N橅wa���V����$t!v܂`Lgd�;���3ClEP�,��€��Q%{�w纡g��<~L����q� �e/�x��d���bz��ͳj�rv�����/|JWǓ�J�A���0&�˱'�|����y�d��)���oS�^!���m+��F�2ul�*�*j*ɭj�4L�Bd)_�X1 g����<Ǟx�� l" �I&������A("�=���DU?�Į�!�%b�y��t��� a\L����,�m@0b�Hs����w�M��&D~A��My(���4c"��g�ym�;�"r 5=�'a�d��w�����n��EUd~�p�*�$B�/aNw8�I*�!%NL�Æ�.�]-@�2����\]��/�sr���yD�%_��� �U�e��l䳵��}\����4��d���`���IC�=N��@L���J�T�gؿa ")_e�"JE˄\�/qvH�'I����Ƕ�W��m?�Tw���A�M�ð%P��_�}��LMc���/�`7eR�k�&�a �,�Rrxz�������n�mx6�H��jT�;��@#���yŮ��;{&�2r�Ư�g�g�pS=��� ����o�����~:>����+[��gw�=?<��_5��_������ao|q~����燑���E��W����x{��^ۧ?�����l�;����<=�������M`����SWs~�N&m�]�o�r���o����o��/���r<��y�����/������~�ѱϿ�0���ի7çl1�����d�B$��C����P�¹]����̽��3�7̅y'0��@O�v_t �o�sg�"?17W�1�OD�XT4�;��)mi,tZw1��I�?Sȕ��i <���m���S.�_Ω�]�R��,���7�s}�“�h�:� �m$�K�RL��+"�B�?��E����H�k�T\ķ���0F���5�+_�"�[��� )�� ?��N��NbmA߳�xg,'Ǣ���:����K��gW�r�}�?�� ƍdOp4�!�g�!���%#P��c�֩�փ�[D����M+k z ��XF� ��Y�ö�Ά��:O�ҦkW� �����ZBvV��fB�f�)��֗�w,CX�uk[H�F"~�΀�V����G���`��Z����C@�Y��� k�`ဗX/\h������T��-�3tՃ���ف�5+��9+)?��x}q���ۧ�J�{�P�%�0�4٥�IH6�ȦS'�y)�|�:є�'��46�9��F��$�J�r`H��Jq|t�G��=� ��9�K�����4���ŌSx�|�l�C%E���M��h�֬@�}���ŝ2�� C q+Z����@�Z��h��3����h3�GFW�[]�_~��˧���w��y��#���ch� ��#��$��h��\�*�Z��ɳ� ��=V�%�~gc#�6�n�c��aK{��yN��|"���wMfr �������}˶ ����#?���<� ��:�}�_y s���l+br(=�VO�`�;{��OO"b� �ٙ�����bn�r�^�(�kW�5,_W{\���%� /��[��k�*_��� j��� �9�2� Ħ�L2~��T,����{me�����x�Q�#��������u�ߧ���{�+����t}W�g2{h�� � #>�}w=AGȱfsn۸d�,�ǃ��/������qQE@q�dI��� �h��DW�\*^�X����m�%p&��m5ĂT��U�����|a��HJ�@c_��Q ��,�]��l�|{��FZ����0��e��l���ǷM�Ƕ��{�3v ��h�}�ktլD���_|p�rJg;�f�p�UQbA�����]����"x����`�69����;�+T̒�/7�ɋ؜$sb;��r?�����Gp{[�@Ǖt6Y���%��H�M�iܳ���{L���ȣ#b�{��w]�BlÏ��J �����w&���B�3H�0*BM��ƴ�&Έ����_31�| -����c!#B� z㉞n��q9[K@<��(>�7I��xHX �#��T�1Q$Q�Z��G��������%���鄥G��)�j�)�好o� J� *DAi��z���R����ɰ� 6l�9�jI�_N_-�48 ��ԃz2/]�M��P��f *��-�sƦ�~<�8vp���-@`��B����B� ���\Ʌ���$N��@s>Kp{�ô)Ug ��Ѹih�n5��XB?��9Uvr�����f#>T�~c�\"�Ybi{O���n�&Ϧ�Y�x��–QtU� �}���L%g�w���K ��"�| ?�(��_�h�H�����ݏch��BC$ɤF�o4��N�{�M��%qI8�X�`l�����7��y(pv*����В+�:M��Ķ�ΐ��5�w��1Dz��/,�� K���@�L�W޼$���`V�]rf†�P�� >H���Yfvn�j�05o��_��d���G�/��_M�}�y{|:}q:�����_O����/���ٓ����}����y���_�z|����?|6�֋K���I��?��������?G���h��\��CVk�z�~~�i2� ��}2 "8� ������qlZS�AB���2������=.�t�F߅-�ړ]��ff7݀{��o�� #rK��;��-NW���zw7�hD��9��������bSw���ٰYF��GqF�#|�2������ ���s�[[[�X�Q��W�ܜ�P�mq�t*�2d'9�f��8s � Ǟ����r0�Eݪ ~����� 7'���� q��|�X��69�P� �Z�\�?�}�}%L��o�6�,����VW����k���r��r��)j�6���vr��|�e�`�5�,YƮ�A[ݠ�-����Ľ��%�g�jMl0�ő���dN��&3��HD��)&�3vLw��Na��ߗa����"� �H' y1� �ŀa4C\�NY0�8�|/�LH�w~O ������ 1����� ���� �3�9�4�d1?K�۾��4�������F�}‰���0򏍏+��c�������?~���`L���e��j���=N}�K���7���퍺��H�a� T^@���"/���"�����~�y.Ƕe�;��A5�m�{M�%n��� ��9���K�3������&ZA�k*�,VG&L�ﲋ1�]q?�-�=�<�7 @�g�du>?Gv+��\��^����&�[v������&����g ���U���O�������>�AC��%]��*]�Ⱥ����Q�Td�q �r;�*�� �u�^��s����7�B�2$�� ���h���S%D�����������[#��p)��8�Fĝ�Ki�x���y�-ɪ����Ј����*x/ �IஊP[�8�P�(#�MH=�ri{�/�����ת����U��K;��kd'���TY�?�XŨs�珵�9< ��$ ��k�wֿ7���8Jҧr��0���+u��� �Sޫp$�&O7�9��'M�n>p��ã7|��R\۴�^�H�4Y��� �t��Ü,iS��c�U��.4,W�����YYs]v$[(w��Q ����_�H�[��ч�����x_���>C�3xA�\K�:�;�}\6�xD����a���i��R �d�#=����W�@��O����_q�%�ᇘV��������cFٰ;���nOӪu�r�".��(ƻD'WIƟ~�ia#Ӓ{7��������s׺���~��2�nH�^� Z�+�4^�L;K��fb~6/�p^j �`ܴ�� �G�L6�%�C` �V�5Һ!Re�H����1$ �g� Hr�`�O�PD���'ӛ��,���P<�a�������1���G���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��%߫�PE+���'�[Jy��_&�r� 8N��- 4��� (v�4���7��