mirror of
https://github.com/RobThree/TwoFactorAuth.git
synced 2026-08-17 11:31:45 +00:00
convert issuer to string prevents php 8.1 errors
By forcing $this->issuer to be string, even if null is set, it prevents throwing errors in PHP 8.1 is `rawurlencode` is not allowed to have null as parameter. It would be better to force string to be already in `__construct`, but this may create a breaking change for existing users.
This commit is contained in:
committed by
GitHub
parent
042f347666
commit
0096cce02d
@@ -272,7 +272,7 @@ class TwoFactorAuth
|
||||
{
|
||||
return 'otpauth://totp/' . rawurlencode($label)
|
||||
. '?secret=' . rawurlencode($secret)
|
||||
. '&issuer=' . rawurlencode($this->issuer)
|
||||
. '&issuer=' . rawurlencode((string)$this->issuer)
|
||||
. '&period=' . intval($this->period)
|
||||
. '&algorithm=' . rawurlencode(strtoupper($this->algorithm))
|
||||
. '&digits=' . intval($this->digits);
|
||||
|
||||
Reference in New Issue
Block a user