Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/twofactor_totp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2016-08-22 12:17:31 +0300
committerChristoph Wurst <christoph@winzerhof-wurst.at>2016-08-22 12:17:31 +0300
commit9fa4b44b4e40632294dfe72ed6e9cf3a9f83250a (patch)
treedf4e1ac5901c414e72aa7f5b0269e8b856a6b70e /lib
parent8eca1cc845375a367f791ac65d14de793fe44547 (diff)
fix url encoding of OTP QR codes
Diffstat (limited to 'lib')
-rw-r--r--lib/Controller/SettingsController.php7
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)");
}
}