You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After debugging for a while in my personal implementation of this library I released it is possible for the following method to return false on failure as well as the decoded string. This can happen when the core PHP base64_decode method returns false on failure because this method is returned in the parent method. To fix possible confusion my suggestion would be to update the method to use a union type to avoid confusion in the future. I imagine this can occur because the class is not strictly typed.
Old:
/** * Decode a string with URL-safe Base64. * * @param string $input A Base64 encoded string * * @return string A decoded string * * @throws InvalidArgumentException invalid base64 characters */publicstaticfunctionurlsafeB64Decode(string$input): string
{
return\base64_decode(self::convertBase64UrlToBase64($input));
}
New:
/** * Decode a string with URL-safe Base64. * * @param string $input A Base64 encoded string * * @return string|false A decoded string or false on failure * * @throws InvalidArgumentException invalid base64 characters */publicstaticfunctionurlsafeB64Decode(string$input): string|false
{
return\base64_decode(self::convertBase64UrlToBase64($input));
}
The text was updated successfully, but these errors were encountered:
After debugging for a while in my personal implementation of this library I released it is possible for the following method to return
false
on failure as well as the decodedstring
. This can happen when the core PHPbase64_decode
method returnsfalse
on failure because this method is returned in the parent method. To fix possible confusion my suggestion would be to update the method to use a union type to avoid confusion in the future. I imagine this can occur because the class is not strictly typed.Old:
New:
The text was updated successfully, but these errors were encountered: