From 334eb48cfe87ad6bbb98a3da54727d12431ca872 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak <alec@alec.pl> Date: Sun, 22 Feb 2015 04:47:15 -0500 Subject: [PATCH] Merge branch 'release-1.1' of github.com:roundcube/roundcubemail into release-1.1 --- program/lib/Roundcube/rcube_db_mysql.php | 23 ++++++++++++++++------- plugins/acl/acl.php | 2 +- program/steps/mail/get.inc | 2 +- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/plugins/acl/acl.php b/plugins/acl/acl.php index 35a92bb..384faa3 100644 --- a/plugins/acl/acl.php +++ b/plugins/acl/acl.php @@ -123,7 +123,7 @@ $group_id = is_array($record[$group_field]) ? $record[$group_field][0] : $record[$group_field]; if ($group) { - $users[] = array('name' => ($prefix ? $prefix : '') . $group_id, 'display' => $group); + $users[] = array('name' => ($prefix ? $prefix : '') . $group_id, 'display' => $group, 'type' => 'group'); $keys[] = $group; } } diff --git a/program/lib/Roundcube/rcube_db_mysql.php b/program/lib/Roundcube/rcube_db_mysql.php index 0e85b0f..067e94b 100644 --- a/program/lib/Roundcube/rcube_db_mysql.php +++ b/program/lib/Roundcube/rcube_db_mysql.php @@ -161,15 +161,24 @@ { if (!isset($this->variables)) { $this->variables = array(); - - $result = $this->query('SHOW VARIABLES'); - - while ($row = $this->fetch_array($result)) { - $this->variables[$row[0]] = $row[1]; - } } - return isset($this->variables[$varname]) ? $this->variables[$varname] : $default; + if (array_key_exists($varname, $this->variables)) { + return $this->variables[$varname]; + } + + $result = $this->query('SHOW VARIABLES LIKE ?', $varname); + + while ($row = $this->fetch_array($result)) { + $this->variables[$row[0]] = $row[1]; + } + + // not found, use default + if (!isset($this->variables[$varname])) { + $this->variables[$varname] = $default; + } + + return $this->variables[$varname]; } /** diff --git a/program/steps/mail/get.inc b/program/steps/mail/get.inc index 02ec5a4..5803e0c 100644 --- a/program/steps/mail/get.inc +++ b/program/steps/mail/get.inc @@ -164,7 +164,7 @@ else { // get valid file extensions $extensions = rcube_mime::get_mime_extensions($real_mimetype); - $valid_extension = !$file_extension || in_array($file_extension, (array)$extensions); + $valid_extension = !$file_extension || empty($extensions) || in_array($file_extension, (array)$extensions); } // fix mimetype for images wrongly declared as octet-stream -- Gitblit v1.9.1