Skip to content

Commit

Permalink
set verify ssl parameter for HTTP based QR provider to true by defaul…
Browse files Browse the repository at this point in the history
…t PR #126
  • Loading branch information
NicolasCARPi authored Apr 27, 2024
2 parents f35f2ae + b964b2a commit f16ea16
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 9 deletions.
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
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

0 comments on commit f16ea16

Please sign in to comment.