File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 160160$ handle = @opendir (ISPC_WEB_PATH .'/dashboard/dashlets ' );
161161while ($ 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+ if (end ($ splitfilename ) == 'php ' ) { // only allow .php files
165+ $ dashlet_name = substr ($ file , 0 , -4 );
166+ $ dashlet_class = 'dashlet_ ' .$ dashlet_name ;
167+ include_once ISPC_WEB_PATH .'/dashboard/dashlets/ ' .$ file ;
168+ $ dashlet_list [$ dashlet_name ] = new $ dashlet_class ;
169+ }
167170 }
168171}
169172
You can’t perform that action at this time.
0 commit comments