From 894d5a4b8b26502a7ff0376e8bb31fbd6794d8dc Mon Sep 17 00:00:00 2001 From: Zankaria Date: Thu, 24 Oct 2024 21:10:51 +0200 Subject: [PATCH] net.php: remove base64 padding from encoded cursor --- inc/functions/net.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inc/functions/net.php b/inc/functions/net.php index 1384f651..963ea524 100644 --- a/inc/functions/net.php +++ b/inc/functions/net.php @@ -20,14 +20,14 @@ function is_connection_secure(): bool { * Encodes a string into a base64 variant without characters illegal in urls. */ function base64_url_encode(string $input): string { - return strtr(base64_encode($input), '+/=', '-_.'); + return str_replace([ '+', '/', '=' ], [ '-', '_', '' ], base64_encode($input)); } /** * Decodes a string from a base64 variant without characters illegal in urls. */ function base64_url_decode(string $input): string { - return base64_decode(strtr($input, '-_.', '+/=')); + return base64_decode(strtr($input, '-_', '+/')); } /**