File tree Expand file tree Collapse file tree 1 file changed +16
-15
lines changed
Expand file tree Collapse file tree 1 file changed +16
-15
lines changed Original file line number Diff line number Diff line change @@ -213,23 +213,24 @@ public static function decode(
213213 'Incorrect padding '
214214 );
215215 }
216- if (extension_loaded ('sodium ' )) {
217- $ variant = match (static ::class) {
218- Base64::class => SODIUM_BASE64_VARIANT_ORIGINAL_NO_PADDING ,
219- Base64UrlSafe::class => SODIUM_BASE64_VARIANT_URLSAFE_NO_PADDING ,
220- default => 0 ,
221- };
222- if ($ variant > 0 ) {
223- try {
224- return sodium_base642bin ($ encodedString , $ variant );
225- } catch (SodiumException $ ex ) {
226- throw new RangeException ($ ex ->getMessage (), $ ex ->getCode (), $ ex );
227- }
216+ }
217+
218+ $ encodedString = rtrim ($ encodedString , '= ' );
219+ $ srcLen = strlen ($ encodedString );
220+
221+ if (extension_loaded ('sodium ' )) {
222+ $ variant = match (static ::class) {
223+ Base64::class => SODIUM_BASE64_VARIANT_ORIGINAL_NO_PADDING ,
224+ Base64UrlSafe::class => SODIUM_BASE64_VARIANT_URLSAFE_NO_PADDING ,
225+ default => 0 ,
226+ };
227+ if ($ variant > 0 ) {
228+ try {
229+ return sodium_base642bin ($ encodedString , $ variant );
230+ } catch (SodiumException $ ex ) {
231+ throw new RangeException ($ ex ->getMessage (), $ ex ->getCode (), $ ex );
228232 }
229233 }
230- } else {
231- $ encodedString = rtrim ($ encodedString , '= ' );
232- $ srcLen = strlen ($ encodedString );
233234 }
234235
235236 $ err = 0 ;
You can’t perform that action at this time.
0 commit comments