aboutsummaryrefslogtreecommitdiffstats
path: root/include/dba/dba_driver.php
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2016-10-13 00:30:41 -0700
committerzotlabs <mike@macgirvin.com>2016-10-13 00:30:41 -0700
commit6532972e61a2aa5e8517ebcca3113adb3c8f336d (patch)
tree1bb8dba43eee1c57746987aee05814d135235a2f /include/dba/dba_driver.php
parent48026efddfdf063fad7c7bd7a86dd7fc4ca4a0a7 (diff)
downloadvolse-hubzilla-6532972e61a2aa5e8517ebcca3113adb3c8f336d.tar.gz
volse-hubzilla-6532972e61a2aa5e8517ebcca3113adb3c8f336d.tar.bz2
volse-hubzilla-6532972e61a2aa5e8517ebcca3113adb3c8f336d.zip
additional array checking
Diffstat (limited to 'include/dba/dba_driver.php')
-rwxr-xr-xinclude/dba/dba_driver.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/dba/dba_driver.php b/include/dba/dba_driver.php
index 36353354c..34597bec4 100755
--- a/include/dba/dba_driver.php
+++ b/include/dba/dba_driver.php
@@ -391,9 +391,22 @@ function dbesc_array_cb(&$item, $key) {
function dbesc_array(&$arr) {
+ $bogus_key = false;
if(is_array($arr) && count($arr)) {
+ $matches = false;
+ foreach($arr as $k => $v) {
+ if(preg_match('/([^a-zA-Z0-9\-\_\.])/',$k,$matches)) {
+ logger('bogus key: ' . $k);
+ $bogus_key = true;
+ }
+ }
array_walk($arr,'dbesc_array_cb');
+ if($bogus_key) {
+ $arr['BOGUS.KEY'] = 1;
+ return false;
+ }
}
+ return true;
}
function db_getfunc($f) {