Browse Source

debug base64_urlencode

stanley-king 7 years atrás
parent
commit
c250bca457
1 changed files with 2 additions and 2 deletions
  1. 2 2
      helper/util_helper.php

+ 2 - 2
helper/util_helper.php

@@ -162,14 +162,14 @@ class util
     public static function base64url_encode($plainText)
     {
         $base64 = base64_encode($plainText);
-        $base64url = strtr($base64, '+/=', '-_,');
+        $base64url = strtr($base64, ['+' => '-','/' => '_','=' => ',']);
         return $base64url;
     }
 
     public static function base64url_decode($plainText)
     {
 
-        $base64url = strtr($plainText, '-_,', '+/=');
+        $base64url = strtr($plainText, ['-' => '+','_' => '/',',' => '=']);
         $base64 = base64_decode($base64url);
         return $base64;
     }