Commit 60df1327 authored by Nigel McNie's avatar Nigel McNie
Browse files

Ignore files in the theme/ directory, only look through directories. Make sure...

Ignore files in the theme/ directory, only look through directories. Make sure to throw a proper exception if a problem occurs getting the theme list also.
parent d440f986
......@@ -376,13 +376,13 @@ function get_themes() {
$themes = array();
$themebase = get_config('docroot') . 'theme/';
if (!$themedir = opendir($themebase)) {
throw new Exception('Unable to read theme directory '.$themebase);
throw new SystemException('Unable to read theme directory '.$themebase);
}
while (false !== ($subdir = readdir($themedir))) {
if ($subdir != "." && $subdir != "..") {
if ($subdir != "." && $subdir != ".." && is_dir($themebase . $subdir)) {
$themes[$subdir] = $subdir;
$config_path = get_config('docroot') . 'theme/' . $subdir . '/config.php';
$config_path = $themebase . $subdir . '/config.php';
if (is_readable($config_path)) {
require_once($config_path);
if (isset($theme->name)) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment