summaryrefslogtreecommitdiff
path: root/idiorm.php
diff options
context:
space:
mode:
authorStefan Andres Charsley <[email protected]>2014-01-12 11:07:34 +1300
committerSimon Holywell <[email protected]>2014-04-26 13:27:54 +0100
commit7b29b766fbe4b3db7601ef045b9c29e6b91736ea (patch)
treea05e8acfbb4e08b868c0a3e356da279e16e3d5b7 /idiorm.php
parent779f1ba4306c51f1366cdcab1a130e3da1627414 (diff)
Added parameter array checking
Testing: Checks the parameter array to ensure the correct number of values inside the parameter with sequential integer indexes. Production: Strips out any non-integer indexes from the parameter array inside the _log_query function.
Diffstat (limited to 'idiorm.php')
-rw-r--r--idiorm.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/idiorm.php b/idiorm.php
index 6b021ad..603bcb2 100644
--- a/idiorm.php
+++ b/idiorm.php
@@ -439,6 +439,11 @@
self::$_query_log[$connection_name] = array();
}
+ // Strip out any non-integer indexes from the parameters
+ foreach($parameters as $key => $value) {
+ if (!is_int($key)) unset($parameters[$key]);
+ }
+
if (count($parameters) > 0) {
// Escape the parameters
$parameters = array_map(array(self::get_db($connection_name), 'quote'), $parameters);