We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 06f5bd5 commit 1571ad8Copy full SHA for 1571ad8
1 file changed
interface/web/dashboard/dashboard.php
@@ -160,10 +160,13 @@
160
$handle = @opendir(ISPC_WEB_PATH.'/dashboard/dashlets');
161
while ($file = @readdir($handle)) {
162
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;
+ $splitfilename = explode('.', $file);
+ if (end($splitfilename) == 'php') { // only allow .php files
+ $dashlet_name = substr($file, 0, -4);
+ $dashlet_class = 'dashlet_'.$dashlet_name;
167
+ include_once ISPC_WEB_PATH.'/dashboard/dashlets/'.$file;
168
+ $dashlet_list[$dashlet_name] = new $dashlet_class;
169
+ }
170
}
171
172
0 commit comments