diff options
Diffstat (limited to 'phpBB/includes')
-rw-r--r-- | phpBB/includes/db/dbal.php | 4 | ||||
-rw-r--r-- | phpBB/includes/functions_jabber.php | 15 | ||||
-rw-r--r-- | phpBB/includes/functions_upload.php | 2 |
3 files changed, 15 insertions, 6 deletions
diff --git a/phpBB/includes/db/dbal.php b/phpBB/includes/db/dbal.php index f79b196e68..d838210d10 100644 --- a/phpBB/includes/db/dbal.php +++ b/phpBB/includes/db/dbal.php @@ -99,8 +99,8 @@ class dbal */ function sql_add_num_queries($cached = false) { - $this->num_queries['cached'] += ($cached) ? 1 : 0; - $this->num_queries['normal'] += ($cached) ? 0 : 1; + $this->num_queries['cached'] += ($cached !== false) ? 1 : 0; + $this->num_queries['normal'] += ($cached !== false) ? 0 : 1; $this->num_queries['total'] += 1; } diff --git a/phpBB/includes/functions_jabber.php b/phpBB/includes/functions_jabber.php index e3edcfc0be..6297dac4bf 100644 --- a/phpBB/includes/functions_jabber.php +++ b/phpBB/includes/functions_jabber.php @@ -695,25 +695,34 @@ class jabber } /** - * parse_data like a="b",c="d",... + * parse_data like a="b",c="d",... or like a="a, b", c, d="e", f=g,... * @param string $data * @access public * @return array a => b ... */ function parse_data($data) { - // super basic, but should suffice $data = explode(',', $data); $pairs = array(); + $key = false; foreach ($data as $pair) { $dd = strpos($pair, '='); + if ($dd) { - $pairs[substr($pair, 0, $dd)] = trim(substr($pair, $dd + 1), '"'); + $key = trim(substr($pair, 0, $dd)); + $pairs[$key] = trim(trim(substr($pair, $dd + 1)), '"'); + } + else if (strpos(strrev(trim($pair)), '"') === 0 && $key) + { + // We are actually having something left from "a, b" values, add it to the last one we handled. + $pairs[$key] .= ',' . trim(trim($pair), '"'); + continue; } } + return $pairs; } diff --git a/phpBB/includes/functions_upload.php b/phpBB/includes/functions_upload.php index 68e06765a5..d3110869af 100644 --- a/phpBB/includes/functions_upload.php +++ b/phpBB/includes/functions_upload.php @@ -577,7 +577,7 @@ class fileupload if (function_exists('mime_content_type')) { - $mimetype = mime_content_type($filename); + $mimetype = mime_content_type($source_file); } // Some browsers choke on a mimetype of application/octet-stream |