From e7e4bb686c8cf50f403dbb657934d4fb5adcc05f Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 3 Apr 2023 04:47:31 +0300 Subject: [PATCH] fix curl exec double call --- library/curl.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/library/curl.php b/library/curl.php index 5f37877..76ccd6b 100644 --- a/library/curl.php +++ b/library/curl.php @@ -3,6 +3,7 @@ class Curl { private $_connection; + private $_response; public function __construct(string $url) { @@ -11,7 +12,7 @@ class Curl { curl_setopt($this->_connection, CURLOPT_RETURNTRANSFER, true); curl_setopt($this->_connection, CURLOPT_TIMEOUT, 5); - curl_exec($this->_connection); + $this->_response = curl_exec($this->_connection); } public function __destruct() { @@ -39,6 +40,6 @@ class Curl { public function getContent() { - return curl_exec($this->_connection); + return $this->_response; } } \ No newline at end of file