diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2016-08-22 12:17:31 +0300 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2016-08-22 12:17:31 +0300 |
commit | 9fa4b44b4e40632294dfe72ed6e9cf3a9f83250a (patch) | |
tree | df4e1ac5901c414e72aa7f5b0269e8b856a6b70e /lib | |
parent | 8eca1cc845375a367f791ac65d14de793fe44547 (diff) |
fix url encoding of OTP QR codes
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Controller/SettingsController.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Controller/SettingsController.php b/lib/Controller/SettingsController.php index 7dd73a0..30f52ab 100644 --- a/lib/Controller/SettingsController.php +++ b/lib/Controller/SettingsController.php @@ -84,7 +84,8 @@ class SettingsController extends Controller { $qrCode = new QrCode(); $secretName = $this->getSecretName(); $issuer = $this->getSecretIssuer(); - $qr = $qrCode->setText("otpauth://totp/$secretName?secret=$secret&issuer=$issuer") + $x = "otpauth://totp/$secretName?secret=$secret&issuer=$issuer"; + $qr = $qrCode->setText($x) ->setSize(150) ->getDataUri(); return [ @@ -102,13 +103,13 @@ class SettingsController extends Controller { private function getSecretName() { $userName = $this->userSession->getUser()->getCloudId(); - return rawurldecode($userName); + return rawurlencode($userName); } private function getSecretIssuer() { $productName = $this->defaults->getName(); $url = $this->urlGenerator->getAbsoluteURL('/'); - return rawurldecode("$url ($productName)"); + return rawurlencode("$url ($productName)"); } } |