Loading core/lib/Drupal/Component/Utility/UrlHelper.php +6 −0 Original line number Diff line number Diff line Loading @@ -80,6 +80,9 @@ public static function buildQuery(array $query, $parent = '') { * The data compressed into a URL-safe string. */ public static function compressQueryParameter(string $data): string { if (!\extension_loaded('zlib')) { return $data; } // Use 'base64url' encoding. Note that the '=' sign is only used for padding // on the right of the string, and is otherwise not part of the data. // @see https://datatracker.ietf.org/doc/html/rfc4648#section-5 Loading @@ -100,6 +103,9 @@ public static function compressQueryParameter(string $data): string { * The uncompressed data or FALSE on failure. */ public static function uncompressQueryParameter(string $compressed): string|bool { if (!\extension_loaded('zlib')) { return $compressed; } // Because this comes from user data, suppress the PHP warning that // gzcompress() throws if the base64-encoded string is invalid. return @gzuncompress(base64_decode(str_replace(['-', '_'], ['+', '/'], $compressed))); Loading Loading
core/lib/Drupal/Component/Utility/UrlHelper.php +6 −0 Original line number Diff line number Diff line Loading @@ -80,6 +80,9 @@ public static function buildQuery(array $query, $parent = '') { * The data compressed into a URL-safe string. */ public static function compressQueryParameter(string $data): string { if (!\extension_loaded('zlib')) { return $data; } // Use 'base64url' encoding. Note that the '=' sign is only used for padding // on the right of the string, and is otherwise not part of the data. // @see https://datatracker.ietf.org/doc/html/rfc4648#section-5 Loading @@ -100,6 +103,9 @@ public static function compressQueryParameter(string $data): string { * The uncompressed data or FALSE on failure. */ public static function uncompressQueryParameter(string $compressed): string|bool { if (!\extension_loaded('zlib')) { return $compressed; } // Because this comes from user data, suppress the PHP warning that // gzcompress() throws if the base64-encoded string is invalid. return @gzuncompress(base64_decode(str_replace(['-', '_'], ['+', '/'], $compressed))); Loading