From 4fa888b46cbd7816b9063de2a06f249105457111 Mon Sep 17 00:00:00 2001 From: jim-p Date: Mon, 21 Dec 2015 10:15:30 -0500 Subject: Encode hostname before printing; remove some related dead code. --- usr/local/www/carp_status.php | 5 ----- usr/local/www/head.inc | 9 +++++---- usr/local/www/pkg.php | 5 ----- usr/local/www/pkg_edit.php | 5 ----- usr/local/www/widgets/widgets/system_information.widget.php | 2 +- usr/local/www/wizard.php | 5 ----- 6 files changed, 6 insertions(+), 25 deletions(-) (limited to 'usr') diff --git a/usr/local/www/carp_status.php b/usr/local/www/carp_status.php index 05af0b9..7a4a5be 100644 --- a/usr/local/www/carp_status.php +++ b/usr/local/www/carp_status.php @@ -41,11 +41,6 @@ require_once("guiconfig.inc"); require_once("globals.inc"); -function gentitle_pkg($pgname) { - global $config; - return $config['system']['hostname'] . "." . $config['system']['domain'] . " - " . $pgname; -} - unset($interface_arr_cache); unset($carp_interface_count_cache); unset($interface_ip_arr_cache); diff --git a/usr/local/www/head.inc b/usr/local/www/head.inc index 9535de3..0fb23e2 100755 --- a/usr/local/www/head.inc +++ b/usr/local/www/head.inc @@ -7,10 +7,11 @@ $g['theme'] = get_current_theme(); $pagetitle = gentitle( $pgtitle ); -if (isset($config['system']['webgui']['pagenamefirst'])) - $tabtitle = $pagetitle . " - " . $config['system']['hostname'] . "." . $config['system']['domain']; -else - $tabtitle = $config['system']['hostname'] . "." . $config['system']['domain'] . " - " . $pagetitle; +if (isset($config['system']['webgui']['pagenamefirst'])) { + $tabtitle = $pagetitle . " - " . htmlspecialchars($config['system']['hostname'] . "." . $config['system']['domain']); +} else { + $tabtitle = htmlspecialchars($config['system']['hostname'] . "." . $config['system']['domain']) . " - " . $pagetitle; +} ?> diff --git a/usr/local/www/pkg.php b/usr/local/www/pkg.php index e07206e..4b600cc 100755 --- a/usr/local/www/pkg.php +++ b/usr/local/www/pkg.php @@ -41,11 +41,6 @@ require_once("guiconfig.inc"); require_once("pkg-utils.inc"); -function gentitle_pkg($pgname) { - global $config; - return $config['system']['hostname'] . "." . $config['system']['domain'] . " - " . $pgname; -} - function domTT_title($title_msg){ print "onmouseout=\"this.style.color = ''; domTT_mouseout(this, event);\" onmouseover=\"domTT_activate(this, event, 'content', '".gettext($title_msg)."', 'trail', true, 'delay', 0, 'fade', 'both', 'fadeMax', 93, 'styleClass', 'niceTitle');\""; } diff --git a/usr/local/www/pkg_edit.php b/usr/local/www/pkg_edit.php index 04caf0a..5047543 100644 --- a/usr/local/www/pkg_edit.php +++ b/usr/local/www/pkg_edit.php @@ -50,11 +50,6 @@ require_once("pkg-utils.inc"); /* dummy stubs needed by some code that was MFC'd */ function pfSenseHeader($location) { header("Location: " . $location); } -function gentitle_pkg($pgname) { - global $pfSense_config; - return $pfSense_config['system']['hostname'] . "." . $pfSense_config['system']['domain'] . " - " . $pgname; -} - function domTT_title($title_msg){ if (!empty($title_msg)){ $title_msg=preg_replace("/\s+/"," ",$title_msg); diff --git a/usr/local/www/widgets/widgets/system_information.widget.php b/usr/local/www/widgets/widgets/system_information.widget.php index 2eed279..8344b9d 100644 --- a/usr/local/www/widgets/widgets/system_information.widget.php +++ b/usr/local/www/widgets/widgets/system_information.widget.php @@ -116,7 +116,7 @@ $filesystems = get_mounted_filesystems(); - + diff --git a/usr/local/www/wizard.php b/usr/local/www/wizard.php index d5aa350..8e5cd7f 100644 --- a/usr/local/www/wizard.php +++ b/usr/local/www/wizard.php @@ -44,11 +44,6 @@ require_once("filter.inc"); require("shaper.inc"); require_once("rrd.inc"); -function gentitle_pkg($pgname) { - global $config; - return $config['system']['hostname'] . "." . $config['system']['domain'] . " - " . $pgname; -} - global $g; $stepid = htmlspecialchars($_GET['stepid']); -- cgit v1.1