Explorar o código

Update Abstract.php

Count issue fix
Shardj %!s(int64=7) %!d(string=hai) anos
pai
achega
47e5c23892
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  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.