jenkins-bot has submitted this change and it was merged.

Change subject: Add URL encoding to TOTP QR code URL
......................................................................


Add URL encoding to TOTP QR code URL

Add RFC 3986 URI encoding to the account label in accordance with the
Google Authenticator specification to ensure the QR code is properly
generated for usernames with special characters in them.

Bug: T136269
Change-Id: I18175c9a3c9a45346fa7a227a5209194385c6696
(cherry picked from commit 7b8a68fd5addb08ad08cf35303cf6010570f0cb9)
---
M special/SpecialOATHEnable.php
1 file changed, 3 insertions(+), 3 deletions(-)

Approvals:
  Alex Monk: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/special/SpecialOATHEnable.php b/special/SpecialOATHEnable.php
index a6e9290..02845ff 100644
--- a/special/SpecialOATHEnable.php
+++ b/special/SpecialOATHEnable.php
@@ -82,9 +82,9 @@
                                array( 'ext.oathauth' ),
                                new XmlJsCode(
                                        'function () {'
-                    . '$("#qrcode").qrcode("otpauth://totp/'
-                    . $this->OATHUser->getAccount()
-                    . '?secret=' . $secret. '");'
+                                       . '$("#qrcode").qrcode("otpauth://totp/'
+                                       . rawurlencode( 
$this->OATHUser->getAccount() )
+                                       . '?secret=' . $secret . '");'
                                        . '}'
                                )
                        ) )

-- 
To view, visit https://gerrit.wikimedia.org/r/291007
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I18175c9a3c9a45346fa7a227a5209194385c6696
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/OATHAuth
Gerrit-Branch: wmf/1.28.0-wmf.3
Gerrit-Owner: Dpatrick <[email protected]>
Gerrit-Reviewer: Alex Monk <[email protected]>
Gerrit-Reviewer: Parent5446 <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to