Skip to content

Commit 839655e

Browse files
authored
5.1.1
1 parent bfc023d commit 839655e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/AllegroScraper.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313

1414
class AllegroScraper
1515
{
16+
const VERSION = "5.1.1";
17+
1618
private string $db_host;
1719
private string $db_name;
1820
private string $db_user;
@@ -91,6 +93,7 @@ private function remoteRequest(string $method, bool $return_as_object, array $pa
9193
{
9294
$parameters['api_key'] = $this->remote_api_key;
9395
$parameters['method'] = $method;
96+
$parameters['version'] = self::VERSION;
9497
$curl = curl_init();
9598
curl_setopt_array($curl, [
9699
CURLOPT_URL => $this->remote_uri . '?' . http_build_query($parameters),
@@ -100,7 +103,7 @@ private function remoteRequest(string $method, bool $return_as_object, array $pa
100103
CURLOPT_TIMEOUT => 360,
101104
CURLOPT_FOLLOWLOCATION => true,
102105
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
103-
CURLOPT_USERAGENT => $_SERVER['HTTP_HOST'],
106+
CURLOPT_USERAGENT => $_SERVER['HTTP_HOST'] ?? '',
104107
CURLOPT_CUSTOMREQUEST => 'GET',
105108
CURLOPT_SSL_VERIFYHOST => false,
106109
CURLOPT_SSL_VERIFYPEER => false

0 commit comments

Comments
 (0)