Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set verify ssl parameter for HTTP based QR provider to true by default #126

Merged
merged 1 commit into from
Apr 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/qr-codes/image-charts.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ title: Image-Charts

Argument | Default value
------------------------|---------------
`$verifyssl` | `false`
`$verifyssl` | `true`
`$errorcorrectionlevel` | `'L'`
`$margin` | `4`

Expand Down
2 changes: 1 addition & 1 deletion docs/qr-codes/qr-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ title: QR Server

Argument | Default value
------------------------|---------------
`$verifyssl` | `false`
`$verifyssl` | `true`
`$errorcorrectionlevel` | `'L'`
`$margin` | `4`
`$qzone` | `1`
Expand Down
2 changes: 1 addition & 1 deletion lib/Providers/Qr/BaseHTTPQRCodeProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

abstract class BaseHTTPQRCodeProvider implements IQRCodeProvider
{
protected bool $verifyssl;
protected bool $verifyssl = true;

protected function getContent(string $url): string|bool
{
Expand Down
2 changes: 1 addition & 1 deletion lib/Providers/Qr/GoogleChartsQrCodeProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// https://developers.google.com/chart/infographics/docs/qr_codes
class GoogleChartsQrCodeProvider extends BaseHTTPQRCodeProvider
{
public function __construct(protected bool $verifyssl = false, public string $errorcorrectionlevel = 'L', public int $margin = 4, public string $encoding = 'UTF-8')
public function __construct(protected bool $verifyssl = true, public string $errorcorrectionlevel = 'L', public int $margin = 4, public string $encoding = 'UTF-8')
{
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Providers/Qr/ImageChartsQRCodeProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/
class ImageChartsQRCodeProvider extends BaseHTTPQRCodeProvider
{
public function __construct(protected bool $verifyssl = false, public string $errorcorrectionlevel = 'L', public int $margin = 1)
public function __construct(protected bool $verifyssl = true, public string $errorcorrectionlevel = 'L', public int $margin = 1)
{
}

Expand Down
4 changes: 2 additions & 2 deletions lib/Providers/Qr/QRServerProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
namespace RobThree\Auth\Providers\Qr;

/**
* Use http://goqr.me/api/doc/create-qr-code/ to get QR code
* Use https://goqr.me/api/doc/create-qr-code/ to get QR code
*/
class QRServerProvider extends BaseHTTPQRCodeProvider
{
public function __construct(protected bool $verifyssl = false, public string $errorcorrectionlevel = 'L', public int $margin = 4, public int $qzone = 1, public string $bgcolor = 'ffffff', public string $color = '000000', public string $format = 'png')
public function __construct(protected bool $verifyssl = true, public string $errorcorrectionlevel = 'L', public int $margin = 4, public int $qzone = 1, public string $bgcolor = 'ffffff', public string $color = '000000', public string $format = 'png')
{
}

Expand Down
3 changes: 1 addition & 2 deletions lib/Providers/Qr/QRicketProvider.php
NicolasCARPi marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@
*/
class QRicketProvider extends BaseHTTPQRCodeProvider
{
public function __construct(public string $errorcorrectionlevel = 'L', public string $bgcolor = 'ffffff', public string $color = '000000', public string $format = 'p')
public function __construct(protected bool $verifyssl = true, public string $errorcorrectionlevel = 'L', public string $bgcolor = 'ffffff', public string $color = '000000', public string $format = 'p')
{
$this->verifyssl = false;
}

public function getMimeType(): string
Expand Down