mirror of
https://github.com/elyby/accounts.git
synced 2024-12-02 11:41:05 +05:30
Не экранируем символы html символы в qr коде, т.к. они всё таки не должны быть экранированы
This commit is contained in:
parent
ec9da1709b
commit
f75c241c5f
@ -63,7 +63,7 @@ class TwoFactorAuthForm extends ApiForm {
|
|||||||
$provisioningUri = $this->getTotp()->getProvisioningUri();
|
$provisioningUri = $this->getTotp()->getProvisioningUri();
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'qr' => 'data:image/svg+xml,' . htmlspecialchars(trim($this->drawQrCode($provisioningUri))),
|
'qr' => 'data:image/svg+xml,' . trim($this->drawQrCode($provisioningUri)),
|
||||||
'uri' => $provisioningUri,
|
'uri' => $provisioningUri,
|
||||||
'secret' => $this->account->otp_secret,
|
'secret' => $this->account->otp_secret,
|
||||||
];
|
];
|
||||||
|
@ -44,7 +44,7 @@ class TwoFactorAuthFormTest extends TestCase {
|
|||||||
$this->assertArrayHasKey('secret', $result);
|
$this->assertArrayHasKey('secret', $result);
|
||||||
$this->assertNotNull($account->otp_secret);
|
$this->assertNotNull($account->otp_secret);
|
||||||
$this->assertEquals($account->otp_secret, $result['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 */
|
/** @var Account|\PHPUnit_Framework_MockObject_MockObject $account */
|
||||||
$account = $this->getMockBuilder(Account::class)
|
$account = $this->getMockBuilder(Account::class)
|
||||||
|
Loading…
Reference in New Issue
Block a user