From 1951f362ef41966533079108dc481003a89ee40d Mon Sep 17 00:00:00 2001 From: popiazaza Date: Sun, 19 Feb 2017 09:51:26 +0700 Subject: [PATCH] Fix cookiepath once again --- manager/Curl.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/manager/Curl.php b/manager/Curl.php index 1769d61..899fc15 100755 --- a/manager/Curl.php +++ b/manager/Curl.php @@ -1,9 +1,9 @@ cookie = realpath($this->cookie); } public function login($url, $data){ @@ -21,10 +21,12 @@ public function login($url, $data){ curl_setopt($login, CURLOPT_FOLLOWLOCATION, TRUE); curl_setopt($login, CURLOPT_POST, TRUE); curl_setopt($login, CURLOPT_POSTFIELDS, $data); - if (curl_exec($ch) === FALSE) { - return curl_error($ch); + curl_setopt($login, CURLOPT_POSTFIELDS, $data); + $curl_result = curl_exec($login); + if ($curl_result === FALSE) { + return curl_error($login); } else { - return curl_exec($ch); + return $curl_result; } } @@ -36,10 +38,11 @@ public function grab_page($site){ curl_setopt($ch, CURLOPT_TIMEOUT, 40); curl_setopt($ch, CURLOPT_COOKIEFILE, $this->cookie); curl_setopt($ch, CURLOPT_URL, $site); - if (curl_exec($ch) === FALSE) { + $curl_result = curl_exec($ch); + if ($curl_result === FALSE) { return curl_error($ch); } else { - return curl_exec($ch); + return $curl_result; } } }