Skip to content

Commit

Permalink
adding referer to curl options
Browse files Browse the repository at this point in the history
  • Loading branch information
Franck ALARY committed Aug 23, 2023
1 parent b53cdce commit 4435522
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,8 @@ public static function fromCurl(string $url, array $curlOptions = [], bool $fail
public function curl(string $url, array $curlOptions = [], bool $failOnError = false): Image
{
$defaultCurlOptions = [
CURLOPT_USERAGENT => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:106.0) Gecko/20100101 Firefox/106.0',
CURLOPT_USERAGENT => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/116.0',
CURLOPT_REFERER => \strtolower($_SERVER["REQUEST_SCHEME"] . '://' . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]),
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_TIMEOUT => 5,
];
Expand Down
2 changes: 1 addition & 1 deletion src/samples/sample6.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
\header('Content-type: image/png');

$image1 = Image::newCanvas(500, 500);
$bbox = $image1->writeTextAndGetBoundingBox('I got the power !', __DIR__ . '/resources/font.ttf', 40, '#FFFFFF', Image::ALIGN_RIGHT, Image::ALIGN_BOTTOM, Image::ALIGN_RIGHT, Image::ALIGN_BOTTOM, 0, 1);
$bbox = $image1->writeTextAndGetBoundingBox('I got the power !', __DIR__ . '/resources/font.ttf', 40, '#FFFFFF', Image::ALIGN_RIGHT, Image::ALIGN_BOTTOM, Image::ALIGN_RIGHT, Image::ALIGN_BOTTOM, 0, 5);

Image::newCanvas(500, 500)
->drawPolygon(
Expand Down

0 comments on commit 4435522

Please sign in to comment.