浏览代码

N°1110 - DataSynchro: PHP Notice Undefined Index
* Fix access to REQUEST_URI when called by script

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@5017 a333f486-631f-4898-b8df-5754b55c2be0

eespie 7 年之前
父节点
当前提交
fd52780b35
共有 1 个文件被更改,包括 6 次插入2 次删除
  1. 6 2
      core/dbobjectsearch.class.php

+ 6 - 2
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);