From 1e29597ab5a02a1620bc8fbbae7b776bbfa53a8b Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Tue, 2 Aug 2011 19:52:49 +0200 Subject: [PATCH] Fixed multiple issues in PreparedStatementConditionBuilder - added missing exception message - replaced the usage of isset with array_key_exists --- .../util/PreparedStatementConditionBuilder.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wcfsetup/install/files/lib/system/database/util/PreparedStatementConditionBuilder.class.php b/wcfsetup/install/files/lib/system/database/util/PreparedStatementConditionBuilder.class.php index 07a898c766..867ce2ec37 100644 --- a/wcfsetup/install/files/lib/system/database/util/PreparedStatementConditionBuilder.class.php +++ b/wcfsetup/install/files/lib/system/database/util/PreparedStatementConditionBuilder.class.php @@ -28,9 +28,9 @@ class PreparedStatementConditionBuilder extends ConditionBuilder { public function add($condition, array $parameters = array()) { if (count($parameters)) { $count = 0; - $callback = function ($matches) use (&$count, $parameters) { - if (!isset($parameters[$count])) { - throw new SystemException(); + $callback = function ($matches) use (&$count, $parameters, $condition) { + if (!array_key_exists($count, $parameters)) { + throw new SystemException("missing parameter for token number " . ($count + 1) . " in condition '".$condition."'"); } $result = '?'; -- 2.20.1