diff --git a/core/dbobjectsearch.class.php b/core/dbobjectsearch.class.php index da9b63431..aa6ca8bc0 100644 --- a/core/dbobjectsearch.class.php +++ b/core/dbobjectsearch.class.php @@ -1470,14 +1470,18 @@ class DBObjectSearch extends DBSearch $bCanCache = true; if (self::$m_bQueryCacheEnabled || self::$m_bTraceQueries) { - if (!empty($_SERVER['REQUEST_URI'])) + if (isset($_SERVER['REQUEST_URI'])) { $aContextData['sRequestUri'] = $_SERVER['REQUEST_URI']; } - else + else if (isset($_SERVER['SCRIPT_NAME'])) { $aContextData['sRequestUri'] = $_SERVER['SCRIPT_NAME']; } + else + { + $aContextData['sRequestUri'] = ''; + } // Need to identify the query $sOqlQuery = $oSearch->ToOql(false, null, true);