/** * 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�xi*[�l�b[�%�m�4I� ��(F�Z��i��_�����%S�ݸ� EJJΜY�8$�]]������٣㓣��޽ �x��>�/�ި/QO9?�0��69x�s�8���̯'����3�]=��yV���\��B�!��qQ�V�]jzC'�� ��`��1=��'�Y�X�S/��t�xQmVWb?6]�2�1��A�sTC��o�*�U?G1��Y�����&��fѸ/���T:�%�9�}�ҡ��c��}i���o�KǢ {���9��#�ti_�hb'�ơ�3"/.)9�!�{V�yZ{�?��h/��71�gb��:@N����b��t�u�ʇ����t�4�%�|� O�$%N��u���^ŵ�楙z����٣GLJg��׵ݙ���L��t�vNi;�("}r- ̈�����}�}�E�L����k��G���~���kzS����Z۸jk�,P^ ��D���Ⴢ |��� �}�Z*u�%h�`�X�j�~D��x�;����%0 T��������V ��*|D��ND��K |��QFԣ!p`�V ���VZqd�z}i�ė#���tbUh�:�,/�_G�}���K�ؙ��9 ����1 ����;�'�J���(4����T��߃�_������9�y%�Vo@/���ܤ� �@֨j���{j�M�dx7=��{���waUH��3��J �Z��@.���֍�04����'�S����j`U��{��1���� i< =����y%�WP_�Zd�~�~�?�T3OG3��X�4t͑���qjw�|����!Ն������2��n��߯�*�=%AW�݇H��b�ӗZ�F�DJ��A]@t��h�~���\��^��~\1e A��b��c�{�UU{��V���?�dG� [�0�z���qmhX7ej~�'�V|_������H����"ea�dO�8�_�6�� �H��^\Y4�_BAT�L�� *pTӶ!�����acQ��O��h�5���3��z/ʪ�;�%d1ח�OS�����0��,� ��g_� +�?� nU�'z I�t2�a.MM��_I��,�MKkt4 �,�V�Z5��|j�sJ|��uo*��GА�畭���-4�r�����>�a}'�w�X��b5S��Q� �H� ��?e]n��� z�*Os0r�{��~��e��$�Q�H�-H�F�K�� 6o䪨��R ��5����Pݼ$֟��K߱���ބ���۰U��Tt�� B�� ��-�k� tX��@����xL�B�_Qam|�լ�Aڧ�k�j�����O��˼9?#D�-+�5�r�Y��j���� �Q��z�y��o!>��;0�/����n�Ԛ�"%Y�h˙����Q�� EIXh�����\p�m��Y�^�RU��>�0��oh))T,�U*|�!۾5E�_�W E�q�O�0��A:3��hj��ۣ1��q���?�A$k #w_eL�bEQ2|�n���jy�|�@�l`PW�=>��cm���P�1�{�S>/��0��1�F ��r�����<�&0֘�_Yqr���c;Q���.�H�#g�lzqr~hӰK`���u�Dc�]�-櫈N' 9,X.˘����D#�����AQ1�w�uF�h�24�Q��-�*���b�Qȸ�M�n�(q����u�η7�d��uS�ǵBa8dLL���1�5#���F���l0US��8��� �ҵ�~�}<{���Z7�����&����L��>�W���`-��Ŧ0pg3<1�,�s���Zh���%�j�^O�zb�i9]Ս&��d\�d��뜍$L�)c%o��G,��H�����kE�p.�ڊbF�� #�(��S3��,z�J�K��Z����z�q ��@�Z ����[�>�ݪ����.ٯ�0�{* ��Kk�ƚ�N�h��B�Z����c-2(�gc'�b�b͖��K�����l��]:������ckhP��ùSh��4���硵�J��2&��X��.��t!*� ���5h��T��h#y�$�F�;�և�:�yh��_�+�C�0pt��颌#t�s.�V�/`�3ôDE�7m:������d�і �-�U�=�Ċ�l�U�kړ�Jҋ�h�ո�~E7 �쎖��dC��z]��z�I +�k���<4e-S&6e]�[��If�`Mb=�)�Ckˍ���8F�iU�s$���T�Q�����Z������7o#o���4gf8Q�; ���� �����ٜ.�V�~�y `ŀ I0�hp�h%iX���w�4 ����[�j-q���dXUZ $h�7p��j�������-�@Ko53���F�UI3!Z�䖱������"�e]72���)��FF�~����6��W���0� F;��1�{2�a����έ ��h��AR����bt#� �:�lݸՌ&���p~ �j����u����K�5~&�B Q��p%���� m[�Ȧ��*kK`Q`ZuB��0Am4B:YRg �����k򛘯6�@��P�u m������4U�U��pE�L��P �:�?�ypM&�j,�bRڦ4Ipr�}4��ҍU��; 2�eeWR�q5Z�],����H��W��HC_E� a���;(yӝ�iH+��q́)e�ҫ��� �H`r���K3���T��bP�!��b%�� hCt �G:H�O _�+�7ĕ—�*M7�[Z�v<� V����HcC� �V�zk̋�VYD6.��,�B+���B��xy�R^�#o�^�K�`� �Cdc�p"�{��`�̗܇���>���w�����^4���_��x�{��6����m���O�6������˃��; �����>�X7�mw�|�v*��e�'��� ����;W�V>뮦�����(���;�X�nY0��2w�_,���b�&vX��p/�6!�i{\��p?������/><${%��l��5��������в��{�Q��4X\d��et+i&K @/A��qq�a� 1���l-�^d24%4����SDUB+Y7��I ~�n�M�_g[@J0.�7��˖,�\g�BV��՝1^������8]&��� �7d�ө��>�c��4՟�f��6�t����m�9�6��c�^t�]a ��l[�?i� ��a�ID���М8��ڌ�'�Æ�=1�ښ���V���m���D�ʙc���eܶwqgG5Ҍ#�[qgGQ4< �$�N�<�7ۃ�~�.�� �pWѰ5l�=���'�븬�ˋ�+�n��~-�e �SZ#/�v�9�M�"䅤2 Q��H�aV:F�Ҵ�f��w���2��N ���V�\R�²�^Q�D�l�hN�ܖ�<\�A�tF%�)�X�0B��w�:KLW�Xs�e*�6�% �J4��_��9��ƴN��K����)������񐱏O'W�D֧����`��S|:�jB�s��;�^RܮJ��)����3�-WhSTh�?�Pyۏ(�����,=�O1���X�]� �����È9��}M^\ ���:��I��\2s�19��9�<�(������5f7�%���Ë��|6���jX�:�c\XҺ<% �b}x4�*��;��V#�d�{q�ZkUeܻL�2�V��)�`>�� %^i��N��.�d���� �������B������٨�� ���[x��w���;o�O.)(��:��-���:H �������<���5�l3�3�xB�d _���$�~X����|*�.��u���?�P6�S7���8����#��D`�w�?��,L�\�LA�[�Y�S��!t�bg�{�JF"�[�������b��>b��V��L7��% �?G��' wW@��%ԑ�3��@�I�L=O�/�и��5x@{�R�P"�nbU�{ӄO���X��9��:?����L4_�.`���z��K���1j[���|�]��.~a R-�XK߁�,�]5�F�j�NG[���v���ߗ��bnryz�}(���oѺ+d8v��d@mRA���Ƨu5��50�{�v�}V��O���o5��k^�K��C��G�e/������y� ʚ�쿁�|�b�3�3�( ���v���D����мD�*|,� �ƁНls�-x�a�-q���j��f� )n�0�����t/`\���0�������iYgF�EB�P��5���ʄ�B,���9p�-|���ݥu���g�mX8���W|0F�����EU�oծ���N.�v���ijU~Hd�$Mnp�o+=<�GC;;�`��Ӄ�SD�@ ��( ��y�o'�Ca�$�Tt!�Fh5��`<�6�v?d������W�����(3|JwO/b���Ds�����;����ER�|B'�١��P����N"�:�����R&�&�[�S<)i�Hn=u �D��rԜV9��o�L̻��Oz�7�*�b* �r� �&Nm$x� ���Z@epTX!��u,\�����gӶ2)���K��Na 8���� ��)k��=�����@�$[c��Y���;�������nNnť�X�Y)?v;�)(%���ĶT�tk�S��O�aز�5�E���/��7,�Eԁ����.h.1Q!.�'!���ʔ�Sk��vv�2�x�u�CaL�Ft<�\�0P� n��]���أ�@�>��׻��^�hd��oj�i���h Z�*ˍ�(F�5�u�+,I�K��t+@-���M9! �X&Ř |,��3���H�-L�,X��P��8`�ܔL��: �4��\���>.a�%���h.��Pdѕ��;_�O��24��)`*z��& M{���Y��v�}�_ c��M���dFZx�?ole}�" G�� � 9�d���[��9˲�0`.tT��ݹn��#E!������N^ᓢ�O^��:]Nπw�zVCmCX�M��7��N�:x2'I"� ����a����P7I�c\���&���H�,|��� I`do[�t2���c�`WIVQSInY��`""K��Ċah8�����9��;�d`Y0N2���/t�B����\&����$v�. !/+�͓6���;^�@��bJ֖ =(PdY� h#2�[,@��ݤ�[.�}V3!� �۔��N3&���n��&�C/"�Ps�S�? �'�����ni w d.�"� ��V�%����~ 㱲uC*�"%@RIQ ��t渙��p�'�B�(CӢ��R���l�&�L�Ll��YɫY�jV ]k����n��}�&�ۗ#�8��LF�@B��81 �l{0_�e�+����s_�����gӈ�+�y���˖Ţ�d�U�o�}�( � ���7>��D71���{� �Y��.�+˕�B�_`�F�%��|�!�(%-r���!a�$%��vw�>�V=���|U�E ���WY�;YB~i���~��4vķ)����v�HJt��3�"��zXI�)�3r=N/馾څgS����E�sG���� �9�����9���j?���_�u�2��5����_�/F㟿�pz���W���͏�H{~|������/?����۫��4������=6/�#����_i��+����ym���j�j���ߺ��v�����F��go��?~;w5�7�lԴ�5NZa�k��w/~q���;~������/��ُ��^�~���g����o�;��ߍ~=��z3�?e�P�\�&�"�5�����zѺ �� <�x#��\�w}� �T�E���ּtF,�ss��D�EE�j�Җ�B��qN�d�3E�\)M�A�a��V��l�@��r�N%��:�:�'�Wľ]w��˦!:�(��0K�YM��; 5Y���]�Ќ��m%�9� ��hS���G����<�h�n+�"�f�b�)tz��m*�)+�����"�\�D�N����"��佄1 7�ɟ9�F�~؊lo'XHqH���0;A�.����Yq��'�s����V�v�c�����|Yn�t��ĸ�� ��0�"�1��¿�b��w��&��xPw�趔��=eCA�D1���kz3�~�v�ڲ�b�B�S�t�j=�}��H��� ��NH��>ƽ��2��e�+�Icm�)"��J�o���ht6��d��l��M갾��u�k�8�am,��� u�^�]>>�*�� ]�����aFv�aÊ�c��J��!^_��r<��)��ɽd����0�٥�IH6�ȦS'��x)�t�:ј,N8�shls<� <�qIҕ*"�+��^D��JqtT��H����y��}�Ks�|-g����bƚ9��%6֡��"�]�&t&t�������*�-0�� } ��(���3]����zSњ] :�Lo� �zG&�3Bz@s­�@�/3�i�S6��;Rqh�ը�����!�9�����Ć�%sm��,k5�c#φ�/�"�X����8[ w��_=��t�`*f�^�ؤj2e�k���Ƽ�8����7tF�0���0�E``���%�uߠ�%��!�t@I�@>�'����>fLĆ���y���]\�k �a�>s�!�J���xP���'5�� _��@AXQ�Xڗ �t]vbYԥQS\�c��pi��8���� ����X�<�A�0�#�y�3c���p|�"{dF��@�9�aH��w gj�lj����k|�1��\�H� a�*ޒ��NO�Y߷6�8�_ɫM|{��ZZ�ƶf0e ��lb�~�n���mu�x�3tЪq��'�JE��潇!�S#��WVp�k��L��y����rU��*q���vhZ�7s�CywI������zl���,:P. z{��0���mⅳ�9a%��hz㺀 ܴ�_���R���c�#��{0<�3��G�\����z\i[�$��� ��ht# �P �p�j�:�}8!&���|yHt���ݢ|�&��`�/)�'z���:��,�Ƣ4|i8n� �ΐ��h ,F' P��� ����I�����]t��W�Оx:a��7�|�������i!��QP�Dg8u��+��)�����dXa�y���S�$�ꦯ���� �<��wb^��a��j6 �Ty�t�" +����Ů|c/�ƌ�$���'oَ=�����K`���]� �("���i�B�/b�T6��"����RQ$���D��D� $^�K�c���:|!~�׃�m`A`�vC�y䜓�%�B8^,��4���o�&I�UVj�?�W4Ll$�2'(�䍭���d�+^G�pz�4�Z*?|ŷ��vڹ`33�� {8��ǖ �3�!�:��B� ���܂ '‡�)I�W�8�{�����ҦT�)�c�Uٖ>0�:V��o�M���2������o �+�H,����}���|W���8�Ho�Z�2����^����х���f\�@�$�\l�N~� �P,�>�oWH���?]{C�?��rI&���`� P�� ����K�L%�H8���^l����&/��p&�������K�[i��̐����w��)Dz�&',�� ��A������6��"�n��3%��V��|*'�Yu�Z��z�kϭ�������L����?���������� |����'�>|�>�|̞���g����̳?����ϧ�����g�m��b�o~���ϽoF������ɡv<>��GÐ���ޟ7_�_~�F�~j�̂p΂���obƱi�y�ct֕�tp #x�Ǖ���໰�V{�#ɾ]v{ xGj�6ݙ0�������6gM�+����t����8M��~F=u|%,4�,����f�C�l���F�O�G�����🟱.N2@T�!�]:t�ܿ�~^�$_Hc�I�`CPx��uuw���*�/��)������N�ݓ�=q��񸱐�w�1Ƚu������É��w'j��-��lb���Td��6����7��^��!Z钶�R�mCiw Q�����7����̛���Xh*�؞�[��V�J��?p�KL�mܪ|�D֔��1y��c�z��w�Ms"�'SI�����a�������h�]��O)/�����`a f*lK���4i,�][�ƛ�ſmi���BȐ�YXa� �:��e0\�{�o��os���/˶���.��[.Ã�����1^cZ�� PMrʡ��vaZ���;(�T|��°ִ��޲X p �:��1[/����k˽?8WW"�{�]6��_#Ȋ��� *ټ^�3OM�u�^ўx������Z��K���Yo3A��D�b;c�t���&;[&Q(�-����t�@�sRN[ Fs0µ蘅}�!1�8�O��y�w�p kX(����Ӥ2ع���&�V��utSX�� 6�>�\����`��t(;a����-���m1f|�����`άz�+���{�d^�_���f� Fs��i����-Y�[��x�p���F����-YD%�����K\>���V~�V�m^�]tr����O������G��&�^�#��X�l���,^����1{ ���|� ʹB�� R忖��yurMJ������3&bwJ��+�]S!��vs��J�2���v!���z�8���'�M�{�:�����9������ʝ��9�EY�\r lTΎ�.��ɩ*��-�x�2��]sQ�:�H�n؇� a��m�O/��tC�����S�Ix~���ץ��ǥ���<3t��L����*�B��KO�����#Y��/LO���_ x��rI�E>M* �%�yf��pT�_-�J���bM��,'̈�1�AE��/��������Q?��#=�%s#���W#���p1���Ƌ"��T ��o=e7|���Vȿ-]��t�ƿqG�J9�pr�{<�-��$�B*lg�C#�g{G$�й��%���v�a��:QF��j���2��-^�w��V���w��U�Ǿ�K��+d/���TY��"�XŨS�珕�9< ��$ \�5�;�߈{-� M�4#���Iq��E^�:�i �)�e8v���^Φ�~v��j������^sU��a���ɵ�HM� �8^��`I��k�ɒ6�:�'�o\�ri[K���lYs]u�[�t�%5 �U>G ?�/�־&�}8:><;����^�!� ����ϵD�`T`{��KRW�d)��DxB@�j�C4a��ޠ_���I��v����R�;�ţ��)=?�|XK/#Dٰ;���u4�\W0"���,Ќb��p4O2��  GV��W�\�_��__��&r_JN����nu�b�����:(^a��q�b��ER�5�yu�s]�#*����5��`& �e�/�v%���4Z��C���v$Q����� ہ$�q ���H�^K8-u?Hb�/佤�P<�aCOY: B�e���ԣ���7>��4�ٌ<�@�̟�B�#���?A�C� �r��'�'�)qB� ��qs�ҧY��ּD|Q���lJ#�� ����l< �������g�2fG��p�,/Ș����� C�o@��!K&��,�ôw�`|��������oB%���J���B䑎|٫ł�8Ś/�B4������ p�t'EȠ��J�v}���Z�za�G W������J[l]$QC_�E2�` s�6�F��d��E$�Ā$��傫���!��k� .��} �����T�iQZ��m�"�5��77�ˌ!2���O� OeP�'�T�VU�s� �<���R�R�v$� ���MnT̫�uy��u���~ �Ƃ0��fvˮ`O�d�ž��܅O��{ᑢ|����� t$ Sl<��K��!~r��U򚚡G&�uI~rk�����Yd �x8a�� Tt�]3Z§�#2�ˁpY� ��s� `�A��} b�#HC���7N�x�j��������!z���w���t_�*�����v�Ơ