summaryrefslogtreecommitdiffstats
path: root/usr/local/www/firewall_rules_edit.php
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2014-09-12 16:36:54 -0300
committerRenato Botelho <garga@FreeBSD.org>2014-09-12 16:37:08 -0300
commit62424bdbbb7b2f37c9a4b6e3531c7024e573317a (patch)
tree29d675e74c7ea900ec74e9019359cbb94c2d1275 /usr/local/www/firewall_rules_edit.php
parent7e7f07aec204236f01a385ebe6f2ae4957d98922 (diff)
downloadpfsense-62424bdbbb7b2f37c9a4b6e3531c7024e573317a.zip
pfsense-62424bdbbb7b2f37c9a4b6e3531c7024e573317a.tar.gz
Remove almost all calls to history.back() and make Cancel button back to HTTP_REFERER, there are a couple of places I didn't touch on this commit because it requires more work
Diffstat (limited to 'usr/local/www/firewall_rules_edit.php')
-rw-r--r--usr/local/www/firewall_rules_edit.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/usr/local/www/firewall_rules_edit.php b/usr/local/www/firewall_rules_edit.php
index da0d0cc..5376a08 100644
--- a/usr/local/www/firewall_rules_edit.php
+++ b/usr/local/www/firewall_rules_edit.php
@@ -45,6 +45,8 @@ require("guiconfig.inc");
require_once("filter.inc");
require("shaper.inc");
+$referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/firewall_rules.php');
+
function is_posnumericint($arg) {
// Note that to be safe we do not allow any leading zero - "01", "007"
return (is_numericint($arg) && $arg[0] != '0' && $arg > 0);
@@ -1251,7 +1253,8 @@ $i--): ?>
<td width="22%" valign="top">&nbsp;</td>
<td width="78%">
&nbsp;<br />&nbsp;
- <input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" /> <input type="button" class="formbtn" value="<?=gettext("Cancel"); ?>" onclick="history.back()" />
+ <input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" />
+ <input type="button" class="formbtn" value="<?=gettext("Cancel");?>" onclick="window.location.href='<?=$referer;?>'" />
<?php if (isset($id) && $a_filter[$id]): ?>
<input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" />
<?php endif; ?>
@@ -1727,7 +1730,8 @@ $has_updated_time = (isset($a_filter[$id]['updated']) && is_array($a_filter[$id]
<td width="22%" valign="top">&nbsp;</td>
<td width="78%">
&nbsp;<br />&nbsp;
- <input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" /> <input type="button" class="formbtn" value="<?=gettext("Cancel"); ?>" onclick="history.back()" />
+ <input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" />
+ <input type="button" class="formbtn" value="<?=gettext("Cancel");?>" onclick="window.location.href='<?=$referer;?>'" />
<?php if (isset($id) && $a_filter[$id]): ?>
<input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" />
<input name="tracker" type="hidden" value="<?=htmlspecialchars($pconfig['tracker']);?>">
OpenPOWER on IntegriCloud