From 44bdab3e380d1c00de10797b396c5f38b9b9155d Mon Sep 17 00:00:00 2001 From: Stefan Andres Charsley Date: Sun, 12 Jan 2014 21:19:37 +1300 Subject: FIX: Added parameter array checking Updated regex to disregard placeholders within quotes. --- test/bootstrap.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/bootstrap.php') 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.'); -- cgit v1.2.3