Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

Commit 7a4aa64

Browse files
Fixed bug in quoteInto with $count parameter and question sign in $value
1 parent 9b9fda8 commit 7a4aa64

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

library/Zend/Db/Adapter/Abstract.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -930,13 +930,7 @@ public function quoteInto($text, $value, $type = null, $count = null)
930930
if ($count === null) {
931931
return str_replace('?', $this->quote($value, $type), $text);
932932
} else {
933-
while ($count > 0) {
934-
if (strpos($text, '?') !== false) {
935-
$text = substr_replace($text, $this->quote($value, $type), strpos($text, '?'), 1);
936-
}
937-
--$count;
938-
}
939-
return $text;
933+
return implode($this->quote($value, $type), explode('?', $text, $count));
940934
}
941935
}
942936

0 commit comments

Comments
 (0)