Skip to content

Commit 5ccd7f2

Browse files
author
Pascal Dreissen
committed
Backport !744 Dashboard enhancements / quota view enhancements using bootstrap progressbars
1 parent 0970332 commit 5ccd7f2

24 files changed

+482
-379
lines changed

interface/web/dashboard/dashboard.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,14 @@
160160
$handle = @opendir(ISPC_WEB_PATH.'/dashboard/dashlets');
161161
while ($file = @readdir($handle)) {
162162
if ($file != '.' && $file != '..' && !is_dir(ISPC_WEB_PATH.'/dashboard/dashlets/'.$file)) {
163-
$dashlet_name = substr($file, 0, -4);
164-
$dashlet_class = 'dashlet_'.$dashlet_name;
165-
include_once ISPC_WEB_PATH.'/dashboard/dashlets/'.$file;
166-
$dashlet_list[$dashlet_name] = new $dashlet_class;
163+
$splitfilename = explode('.', $file);
164+
$file_extension = pathinfo($file)['extension'];
165+
if ($file_extension === 'php') { // only allow .php files
166+
$dashlet_name = substr($file, 0, -4);
167+
$dashlet_class = 'dashlet_'.$dashlet_name;
168+
include_once ISPC_WEB_PATH.'/dashboard/dashlets/'.$file;
169+
$dashlet_list[$dashlet_name] = new $dashlet_class;
170+
}
167171
}
168172
}
169173

0 commit comments

Comments
 (0)