diff options
author | Scott Ullrich <sullrich@sullrich-MacBookPro.local> | 2009-02-14 22:44:09 -0500 |
---|---|---|
committer | Scott Ullrich <sullrich@sullrich-MacBookPro.local> | 2009-02-14 22:44:09 -0500 |
commit | 916b74c6047532a3ce15f7a22f86be7b17fafa6f (patch) | |
tree | 21c23b9d1ac472d895aa0d293ee8376a2b61f275 /usr/local/www/pkg_edit.php | |
parent | b24bda0840cc8eb238f26cabfff4e849ccbdb96d (diff) | |
download | pfsense-916b74c6047532a3ce15f7a22f86be7b17fafa6f.zip pfsense-916b74c6047532a3ce15f7a22f86be7b17fafa6f.tar.gz |
When editing a record and not posting, there must be a valid id.
This will fix pages coming in from after authing that accidently
drop &id=0
Diffstat (limited to 'usr/local/www/pkg_edit.php')
-rwxr-xr-x | usr/local/www/pkg_edit.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/usr/local/www/pkg_edit.php b/usr/local/www/pkg_edit.php index 5a1a3bf..24f0b4e 100755 --- a/usr/local/www/pkg_edit.php +++ b/usr/local/www/pkg_edit.php @@ -39,7 +39,7 @@ require_once("guiconfig.inc"); require_once("pkg-utils.inc"); /* dummy stubs needed by some code that was MFC'd */ -function pfSenseHeader($location) { header("Location: $location"); } +function pfSenseHeader($location) { header("Location: " . $location); } function gentitle_pkg($pgname) { global $pfSense_config; @@ -75,7 +75,12 @@ $pgtitle = $title; $id = $_GET['id']; if (isset($_POST['id'])) $id = htmlspecialchars($_POST['id']); - + +// Not posting? Then user is editing a record. There must be a valid id +// when editing a record. +if(!$id && !$_POST) + $id = "0"; + if($pkg['custom_php_global_functions'] <> "") eval($pkg['custom_php_global_functions']); |