Skip to content

Commit 93334cd

Browse files
committed
Use translate() instead of replace(replace())
Author: Andreas Karlsson
1 parent f316e83 commit 93334cd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

FUNCTIONS/base64_url_decode.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ CREATE OR REPLACE FUNCTION webauthn.base64_url_decode(text)
22
RETURNS bytea
33
IMMUTABLE
44
LANGUAGE sql AS $$
5-
SELECT decode(rpad(replace(replace($1,'-','+'),'_','/'),length($1) + (4 - length($1) % 4) % 4, '='),'base64')
5+
SELECT decode(rpad(translate($1,'-_','+/'),length($1) + (4 - length($1) % 4) % 4, '='),'base64')
66
$$;

0 commit comments

Comments
 (0)