Jelajahi Sumber

Fixed bug in quoteInto with $count parameter and question sign in $value

Ivan A. Ponomarev 11 tahun lalu
induk
melakukan
7a4aa64235
1 mengubah file dengan 1 tambahan dan 7 penghapusan
  1. 1 7
      library/Zend/Db/Adapter/Abstract.php

+ 1 - 7
library/Zend/Db/Adapter/Abstract.php

@@ -930,13 +930,7 @@ abstract class Zend_Db_Adapter_Abstract
         if ($count === null) {
             return str_replace('?', $this->quote($value, $type), $text);
         } else {
-            while ($count > 0) {
-                if (strpos($text, '?') !== false) {
-                    $text = substr_replace($text, $this->quote($value, $type), strpos($text, '?'), 1);
-                }
-                --$count;
-            }
-            return $text;
+            return implode($this->quote($value, $type), explode('?', $text, $count));
         }
     }