소스 검색

Internal: OQL error reporting

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@4717 a333f486-631f-4898-b8df-5754b55c2be0
glajarige 8 년 전
부모
커밋
4988d1d8d7
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      core/dbobjectsearch.class.php

+ 2 - 0
core/dbobjectsearch.class.php

@@ -411,12 +411,14 @@ class DBObjectSearch extends DBSearch
 
 		case "IN":
 			if (!is_array($value)) $value = array($value);
+			if (count($value) === 0) throw new Exception('AddCondition '.$sOpCode.': Value cannot be an empty array.');
 			$sListExpr = '('.implode(', ', CMDBSource::Quote($value)).')';
 			$sOQLCondition = $oField->Render()." IN $sListExpr";
 			break;
 
 		case "NOTIN":
 			if (!is_array($value)) $value = array($value);
+            if (count($value) === 0) throw new Exception('AddCondition '.$sOpCode.': Value cannot be an empty array.');
 			$sListExpr = '('.implode(', ', CMDBSource::Quote($value)).')';
 			$sOQLCondition = $oField->Render()." NOT IN $sListExpr";
 			break;