Index: branches/5.2.x/core/units/helpers/curl_helper.php =================================================================== diff -u -N -r14244 -r14585 --- branches/5.2.x/core/units/helpers/curl_helper.php (.../curl_helper.php) (revision 14244) +++ branches/5.2.x/core/units/helpers/curl_helper.php (.../curl_helper.php) (revision 14585) @@ -1,6 +1,6 @@ 1, CURLOPT_REFERER => PROTOCOL.SERVER_NAME, - CURLOPT_USERAGENT => $_SERVER['HTTP_USER_AGENT'], // don't verify SSL certificates CURLOPT_SSL_VERIFYPEER => false, + CURLOPT_SSL_VERIFYHOST => false, CURLOPT_HTTPHEADER => Array ('Expect:'), ); + if ( isset($_SERVER['HTTP_USER_AGENT']) ) { + $default_options[CURLOPT_USERAGENT] = $_SERVER['HTTP_USER_AGENT']; + } + if ($this->requestHeaders) { $default_options[CURLOPT_HTTPHEADER] = $this->prepareHeaders(); } @@ -338,7 +342,7 @@ if ($this->debugMode) { kUtil::safeDefine('DBG_CURL_LOGFILE', '/curl.log'); - $this->logFilePointer = fopen(FULL_PATH.DBG_CURL_LOGFILE, 'a'); + $this->logFilePointer = fopen((defined('RESTRICTED') ? RESTRICTED : FULL_PATH) . DBG_CURL_LOGFILE, 'a'); $user_id = $this->Application->RecallVar('user_id'); $data = $_SERVER['REMOTE_ADDR'] . ' - ['.adodb_date('D M d H:i:s Y').'] ' . $_SERVER['REQUEST_URI'] . '; user_id: '.$user_id.'; sid: '.$this->Application->GetSID(); @@ -413,4 +417,13 @@ // restore debug mode setting $this->debugMode = kUtil::constOn('DBG_CURL'); } + + function isGoodResponceCode() + { + if ($this->lastErrorCode != 0) { + return false; + } + + return ($this->lastHTTPCode == 200) || ($this->lastHTTPCode >= 300 && $this->lastHTTPCode < 310); + } } \ No newline at end of file