Index: kernel/globals.php =================================================================== --- kernel/globals.php (revision 14103) +++ kernel/globals.php (working copy) @@ -362,7 +362,11 @@ curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch,CURLOPT_REFERER, PROTOCOL.SERVER_NAME); - curl_setopt($ch,CURLOPT_USERAGENT,$_SERVER['HTTP_USER_AGENT']); + + if ( isset($_SERVER['HTTP_USER_AGENT']) ) { + curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); + } + curl_setopt($ch,CURLOPT_FOLLOWLOCATION, 0); curl_setopt($ch, CURLOPT_TIMEOUT, 90); Index: kernel/session/inp_session.php =================================================================== --- kernel/session/inp_session.php (revision 14103) +++ kernel/session/inp_session.php (working copy) @@ -117,11 +117,14 @@ 'PortalUserId' => $this->Application->isAdmin ? 0 : USER_GUEST, 'Language' => $this->Application->GetDefaultLanguageId(true), 'Theme' => $this->Application->GetDefaultThemeId(), - 'IpAddress' => $_SERVER['REMOTE_ADDR'], // getenv('REMOTE_ADDR') won't work on IIS, so use $_SERVER instead 'GroupId' => $this->Application->ConfigValue('User_GuestGroup'), 'GroupList' => $this->Application->ConfigValue('User_GuestGroup'), ); + if( isset($_SERVER['REMOTE_ADDR']) ) { + $fields_hash['IpAddress'] = $_SERVER['REMOTE_ADDR']; // getenv('REMOTE_ADDR') won't work on IIS, so use $_SERVER instead + } + parent::StoreSession($session, $fields_hash); } Index: kernel/utility/http_query.php =================================================================== --- kernel/utility/http_query.php (revision 14103) +++ kernel/utility/http_query.php (working copy) @@ -105,7 +105,7 @@ $this->Conn =& $this->Application->GetADODBConnection(); $this->Order = $order; - if (array_key_exists('HTTP_X_REQUESTED_WITH', $_SERVER) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') { + if ( isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') { // when AJAX request is made from jQuery, then create ajax variable, // so any logic based in it (like redirects) will not break down $_GET['ajax'] = 'yes'; Index: units/helpers/curl_helper.php =================================================================== --- units/helpers/curl_helper.php (revision 14103) +++ units/helpers/curl_helper.php (working copy) @@ -132,13 +132,16 @@ // hardcoded options CURLOPT_RETURNTRANSFER => 1, CURLOPT_REFERER => PROTOCOL.SERVER_NAME, - CURLOPT_USERAGENT => $_SERVER['HTTP_USER_AGENT'], - + // don't verify SSL certificates CURLOPT_SSL_VERIFYPEER => 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(); }