diff --git a/plugins/acl/acl.php b/plugins/acl/acl.php index 35a92bb1c..384faa3b7 100644 --- a/plugins/acl/acl.php +++ b/plugins/acl/acl.php @@ -123,7 +123,7 @@ class acl extends rcube_plugin $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 0e85b0f9c..067e94be6 100644 --- a/program/lib/Roundcube/rcube_db_mysql.php +++ b/program/lib/Roundcube/rcube_db_mysql.php @@ -161,15 +161,24 @@ class rcube_db_mysql extends rcube_db { if (!isset($this->variables)) { $this->variables = array(); + } - $result = $this->query('SHOW VARIABLES'); + if (array_key_exists($varname, $this->variables)) { + return $this->variables[$varname]; + } - while ($row = $this->fetch_array($result)) { - $this->variables[$row[0]] = $row[1]; - } + $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 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 02ec5a4ac..5803e0c5a 100644 --- a/program/steps/mail/get.inc +++ b/program/steps/mail/get.inc @@ -164,7 +164,7 @@ else if (strlen($part_id)) { 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