diff options
| -rw-r--r-- | lib/lib_rss.php | 8 | ||||
| -rw-r--r-- | public/install.php | 7 |
2 files changed, 4 insertions, 11 deletions
diff --git a/lib/lib_rss.php b/lib/lib_rss.php index 7f22c8244..2f694fc12 100644 --- a/lib/lib_rss.php +++ b/lib/lib_rss.php @@ -9,14 +9,10 @@ function login_is_conf ($conf) { return $conf->mailLogin () != false; } -// tiré de Shaarli de Seb Sauvage +// tiré de Shaarli de Seb Sauvage //Format RFC 4648 base64url function small_hash ($txt) { $t = rtrim (base64_encode (hash ('crc32', $txt, true)), '='); - $t = str_replace ('+', '-', $t); // Get rid of characters which need encoding in URLs. - $t = str_replace ('/', '_', $t); - $t = str_replace ('=', '@', $t); - - return $t; + return strtr ($t, '+/', '-_'); } function timestamptodate ($t, $hour = true) { diff --git a/public/install.php b/public/install.php index 5b0618c37..0c39a031e 100644 --- a/public/install.php +++ b/public/install.php @@ -66,13 +66,10 @@ function writeArray ($f, $array) { } } +// tiré de Shaarli de Seb Sauvage //Format RFC 4648 base64url function small_hash ($txt) { $t = rtrim (base64_encode (hash ('crc32', $txt, true)), '='); - $t = str_replace ('+', '-', $t); // Get rid of characters which need encoding in URLs. - $t = str_replace ('/', '_', $t); - $t = str_replace ('=', '@', $t); - - return $t; + return strtr ($t, '+/', '-_'); } // gestion internationalisation |
