summaryrefslogtreecommitdiff
path: root/test/bootstrap.php
diff options
context:
space:
mode:
authorStefan Andres Charsley <[email protected]>2014-01-12 21:19:37 +1300
committerSimon Holywell <[email protected]>2014-04-26 13:27:54 +0100
commit44bdab3e380d1c00de10797b396c5f38b9b9155d (patch)
tree9f041946e90a5c2b687b47886e414c816b7eba48 /test/bootstrap.php
parent87505a3271fa681cab90c0c306f47827713e510b (diff)
FIX: Added parameter array checking
Updated regex to disregard placeholders within quotes.
Diffstat (limited to 'test/bootstrap.php')
-rw-r--r--test/bootstrap.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/bootstrap.php b/test/bootstrap.php
index 7277761..d541e7b 100644
--- a/test/bootstrap.php
+++ b/test/bootstrap.php
@@ -24,7 +24,7 @@ class MockPDOStatement extends PDOStatement {
public function execute($params) {
$count = 0;
$m = array();
- if (preg_match_all('/\\?/', $this->statement, $m)) {
+ if (preg_match_all('/"[^"\\]*(?:\?)[^"\\]*"|\'[^\'\\]*(?:\?)[^\'\\]*\'|(\?)/', $this->statement, $m)) {
$count = count($m);
for ($i = 0; $i < $count; $i++) {
if ($params[$i] == NULL) throw new Exception('Incorrect parameter count.');