PHPGangsta / GoogleAuthenticator

PHP class to generate and verify Google Authenticator 2-factor authentication
http://phpgangsta.de/4376
BSD 2-Clause "Simplified" License
2.26k stars 698 forks source link

Changed QR Code #76

Open JE4GLE opened 5 years ago

JE4GLE commented 5 years ago

The QR-Code requires the title to be in front of the name seperated by ':' to be displayed in apps like Authy

MarkMaldaba commented 3 years ago

This PR contains an error - it is using urlencode() inside of urlencode() meaning that the title is being escaped twice.

The problem it attempts to fix is valid and the solution seems reasonable aside from the above (though I would avoid inline short-form if statements in complex expressions and split it out into a normal if() condition to update $name before the string is built, to make the code more readable).

MarkMaldaba commented 3 years ago

Note that PR #80 contains an alternative solution to the same problem, though it also suffers from the double-escaping issue.