mirror of
https://github.com/unraid/webgui.git
synced 2026-01-14 13:39:58 -06:00
Merge pull request #798 from Squidly271/patch-4
Protect GUI from invalid .page files
This commit is contained in:
@@ -31,7 +31,8 @@ function build_pages($pattern) {
|
||||
global $site;
|
||||
foreach (glob($pattern,GLOB_NOSORT) as $entry) {
|
||||
[$header, $content] = explode("---\n", file_get_contents($entry),2);
|
||||
$page = parse_ini_string($header);
|
||||
$page = @parse_ini_string($header);
|
||||
if ( ! $page ) exec("logger -t 'webGUI' Invalid .page format: $entry");
|
||||
$page['file'] = $entry;
|
||||
$page['root'] = dirname($entry);
|
||||
$page['name'] = basename($entry, '.page');
|
||||
|
||||
Reference in New Issue
Block a user