Skip to content

Commit 4435522

Browse files
committed
adding referer to curl options
1 parent b53cdce commit 4435522

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/Image.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,8 @@ public static function fromCurl(string $url, array $curlOptions = [], bool $fail
307307
public function curl(string $url, array $curlOptions = [], bool $failOnError = false): Image
308308
{
309309
$defaultCurlOptions = [
310-
CURLOPT_USERAGENT => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:106.0) Gecko/20100101 Firefox/106.0',
310+
CURLOPT_USERAGENT => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/116.0',
311+
CURLOPT_REFERER => \strtolower($_SERVER["REQUEST_SCHEME"] . '://' . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]),
311312
CURLOPT_RETURNTRANSFER => 1,
312313
CURLOPT_TIMEOUT => 5,
313314
];

src/samples/sample6.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
\header('Content-type: image/png');
99

1010
$image1 = Image::newCanvas(500, 500);
11-
$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);
11+
$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);
1212

1313
Image::newCanvas(500, 500)
1414
->drawPolygon(

0 commit comments

Comments
 (0)