소스 검색

Update Abstract.php

Count issue fix
Shardj 7 년 전
부모
커밋
47e5c23892
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 1
      library/Zend/Db/Table/Abstract.php

+ 5 - 1
library/Zend/Db/Table/Abstract.php

@@ -1304,7 +1304,11 @@ abstract class Zend_Db_Table_Abstract
         $whereList = array();
         $numberTerms = 0;
         foreach ($args as $keyPosition => $keyValues) {
-            $keyValuesCount = count($keyValues);
+            if (is_array($keyValues) || $keyValues instanceof Countable) {
+                $keyValuesCount = count($keyValues);
+            } else {
+                $keyValuesCount = 1;
+            }
             // Coerce the values to an array.
             // Don't simply typecast to array, because the values
             // might be Zend_Db_Expr objects.