Commit d7319957 authored by Franco Fichtner's avatar Franco Fichtner

dashboard: this needs absolte redirects, some missed spots

Relative redirect is used almost everywhere, but to be honest
it looks safer to make all paths absolute.

PR: https://github.com/opnsense/core/issues/1168
parent a85a46b8
...@@ -125,8 +125,8 @@ if (is_numeric($_POST['filterlogentries'])) { ...@@ -125,8 +125,8 @@ if (is_numeric($_POST['filterlogentries'])) {
} }
write_config("Saved Filter Log Entries via Dashboard"); write_config("Saved Filter Log Entries via Dashboard");
Header("Location: /"); header(url_safe('Location: /index.php'));
exit(0); exit;
} }
$nentries = isset($config['widgets']['filterlogentries']) ? $config['widgets']['filterlogentries'] : 5; $nentries = isset($config['widgets']['filterlogentries']) ? $config['widgets']['filterlogentries'] : 5;
......
...@@ -58,7 +58,7 @@ if ($_POST) { ...@@ -58,7 +58,7 @@ if ($_POST) {
$config['widgets']['picturewidget'] = base64_encode($data); $config['widgets']['picturewidget'] = base64_encode($data);
$config['widgets']['picturewidget_filename'] = $_FILES['pictfile']['name']; $config['widgets']['picturewidget_filename'] = $_FILES['pictfile']['name'];
write_config("Picture widget saved via Dashboard."); write_config("Picture widget saved via Dashboard.");
header(url_safe('Location: index.php')); header(url_safe('Location: /index.php'));
exit; exit;
} }
} }
......
...@@ -44,7 +44,7 @@ if (!empty($_POST['rssfeed'])) { ...@@ -44,7 +44,7 @@ if (!empty($_POST['rssfeed'])) {
$config['widgets']['rsswidgetheight'] = htmlspecialchars($_POST['rsswidgetheight'], ENT_QUOTES | ENT_HTML401); $config['widgets']['rsswidgetheight'] = htmlspecialchars($_POST['rsswidgetheight'], ENT_QUOTES | ENT_HTML401);
$config['widgets']['rsswidgettextlength'] = htmlspecialchars($_POST['rsswidgettextlength'], ENT_QUOTES | ENT_HTML401); $config['widgets']['rsswidgettextlength'] = htmlspecialchars($_POST['rsswidgettextlength'], ENT_QUOTES | ENT_HTML401);
write_config("Saved RSS Widget feed via Dashboard"); write_config("Saved RSS Widget feed via Dashboard");
header(url_safe('Location: index.php')); header(url_safe('Location: /index.php'));
exit; exit;
} }
......
...@@ -41,7 +41,7 @@ $services = services_get(); ...@@ -41,7 +41,7 @@ $services = services_get();
if (isset($_POST['servicestatusfilter'])) { if (isset($_POST['servicestatusfilter'])) {
$config['widgets']['servicestatusfilter'] = htmlspecialchars($_POST['servicestatusfilter'], ENT_QUOTES | ENT_HTML401); $config['widgets']['servicestatusfilter'] = htmlspecialchars($_POST['servicestatusfilter'], ENT_QUOTES | ENT_HTML401);
write_config("Saved Service Status Filter via Dashboard"); write_config("Saved Service Status Filter via Dashboard");
header(url_safe('Location: index.php')); header(url_safe('Location: /index.php'));
exit; exit;
} }
......
...@@ -40,7 +40,7 @@ if (is_numeric($_POST['logfiltercount'])) { ...@@ -40,7 +40,7 @@ if (is_numeric($_POST['logfiltercount'])) {
$countReceived = $_POST['logfiltercount']; $countReceived = $_POST['logfiltercount'];
$config['widgets']['systemlogfiltercount'] = $countReceived; $config['widgets']['systemlogfiltercount'] = $countReceived;
write_config("Saved Widget System Log Filter Setting"); write_config("Saved Widget System Log Filter Setting");
Header("Location: /index.php"); header(url_safe('Location: /index.php'));
exit; exit;
} }
......
...@@ -55,7 +55,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -55,7 +55,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$config['widgets']['thermal_sensors_widget'][$fieldname] = validate_temp_value($newValue) ? $newValue : $defaultValue; $config['widgets']['thermal_sensors_widget'][$fieldname] = validate_temp_value($newValue) ? $newValue : $defaultValue;
} }
write_config("Thermal sensors widget saved via Dashboard."); write_config("Thermal sensors widget saved via Dashboard.");
header(url_safe('Location: index.php')); header(url_safe('Location: /index.php'));
exit; exit;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment