Browse Source

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@5007 a333f486-631f-4898-b8df-5754b55c2be0

eespie 7 years ago
parent
commit
c94c84183a
1 changed files with 8 additions and 1 deletions
  1. 8 1
      core/dbobjectsearch.class.php

+ 8 - 1
core/dbobjectsearch.class.php

@@ -1469,7 +1469,14 @@ class DBObjectSearch extends DBSearch
 		$aContextData = array();
 		if (self::$m_bQueryCacheEnabled || self::$m_bTraceQueries)
 		{
-			$aContextData['sRequestUri'] = $_SERVER['REQUEST_URI'];
+			if (!empty($_SERVER['REQUEST_URI']))
+			{
+				$aContextData['sRequestUri'] = $_SERVER['REQUEST_URI'];
+			}
+			else
+			{
+				$aContextData['sRequestUri'] = $_SERVER['SCRIPT_NAME'];
+			}
 
 			// Need to identify the query
 			$sOqlQuery = $oSearch->ToOql(false, null, true);