From 491ade783ee9548624f78552995ed3433076505d Mon Sep 17 00:00:00 2001 From: Hendrik Obermayer Date: Fri, 14 Dec 2012 15:11:23 +0100 Subject: [PATCH 1/2] set header to text/plain --- example.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/example.php b/example.php index 94ded47..988ad06 100644 --- a/example.php +++ b/example.php @@ -1,4 +1,5 @@ getURL('chregu','example.org',$secret); -print "\n"; \ No newline at end of file +print "\n"; From af88726f744515c02c5fb14643b7d39adec18fba Mon Sep 17 00:00:00 2001 From: Hendrik Obermayer Date: Fri, 14 Dec 2012 15:17:49 +0100 Subject: [PATCH 2/2] fix #3 invalid barcode url --- lib/GoogleAuthenticator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/GoogleAuthenticator.php b/lib/GoogleAuthenticator.php index 344c034..7343b04 100644 --- a/lib/GoogleAuthenticator.php +++ b/lib/GoogleAuthenticator.php @@ -66,7 +66,7 @@ protected function hashToInt($bytes, $start) { public function getUrl($user, $hostname, $secret) { $url = sprintf("otpauth://totp/%s@%s?secret=%s", $user, $hostname, $secret); $encoder = "https://www.google.com/chart?chs=200x200&chld=M|0&cht=qr&chl="; - $encoderURL = sprintf( "%sotpauth://totp/%s@%s&secret=%s",$encoder, $user, $hostname, $secret); + $encoderURL = sprintf( "%sotpauth://totp/%s@%s%ssecret=%s",$encoder, $user, $hostname, '%3F', $secret); return $encoderURL;