mirror of
https://github.com/unraid/webgui.git
synced 2026-01-06 01:29:54 -06:00
feat: implement safe title processing in MainContent, MainContentTabbed, and MainContentTabless
- Introduced a new function `processTitle` to safely handle page titles by replacing PHP variables with their values without using eval. - Updated title handling in MainContent, MainContentTabbed, and MainContentTabless to utilize the new `processTitle` function, enhancing security and maintainability.
This commit is contained in:
@@ -10,10 +10,7 @@
|
||||
<? $i = 0; ?>
|
||||
<? foreach ($pages as $page): ?>
|
||||
<? if (!isset($page['Title'])) continue; ?>
|
||||
<?
|
||||
/** ensures variables in any .page title are used */
|
||||
eval("\$title=\"".htmlspecialchars((string)$page['Title'])."\";");
|
||||
?>
|
||||
<? $title = processTitle($page['Title']); ?>
|
||||
<? $tabId = "tab" . ($i+1); ?>
|
||||
<button
|
||||
role="tab"
|
||||
@@ -35,6 +32,7 @@
|
||||
if (!isset($page['Title'])) {
|
||||
continue;
|
||||
}
|
||||
$title = processTitle($page['Title']);
|
||||
$tabId = "tab" . ($i+1);
|
||||
annotate($page['file']);
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user