Не экранируем символы html символы в qr коде, т.к. они всё таки не должны быть экранированы

This commit is contained in:
ErickSkrauch 2017-08-03 14:50:48 +03:00
parent ec9da1709b
commit f75c241c5f
2 changed files with 2 additions and 2 deletions

View File

@ -63,7 +63,7 @@ class TwoFactorAuthForm extends ApiForm {
$provisioningUri = $this->getTotp()->getProvisioningUri();
return [
'qr' => 'data:image/svg+xml,' . htmlspecialchars(trim($this->drawQrCode($provisioningUri))),
'qr' => 'data:image/svg+xml,' . trim($this->drawQrCode($provisioningUri)),
'uri' => $provisioningUri,
'secret' => $this->account->otp_secret,
];

View File

@ -44,7 +44,7 @@ class TwoFactorAuthFormTest extends TestCase {
$this->assertArrayHasKey('secret', $result);
$this->assertNotNull($account->otp_secret);
$this->assertEquals($account->otp_secret, $result['secret']);
$this->assertEquals('data:image/svg+xml,<_/>', $result['qr']);
$this->assertEquals('data:image/svg+xml,<_/>', $result['qr']);
/** @var Account|\PHPUnit_Framework_MockObject_MockObject $account */
$account = $this->getMockBuilder(Account::class)