diff options
author | Stefan Andres Charsley <[email protected]> | 2014-01-12 21:19:37 +1300 |
---|---|---|
committer | Simon Holywell <[email protected]> | 2014-04-26 13:27:54 +0100 |
commit | 44bdab3e380d1c00de10797b396c5f38b9b9155d (patch) | |
tree | 9f041946e90a5c2b687b47886e414c816b7eba48 /test/bootstrap.php | |
parent | 87505a3271fa681cab90c0c306f47827713e510b (diff) |
FIX: Added parameter array checking
Updated regex to disregard placeholders within quotes.
Diffstat (limited to 'test/bootstrap.php')
-rw-r--r-- | test/bootstrap.php | 2 |
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.'); |