diff options
author | NOYB <Al_Stu@Frontier.com> | 2016-03-18 02:07:45 -0700 |
---|---|---|
committer | Stephen Beaver <sbeaver@netgate.com> | 2016-03-18 10:21:10 -0400 |
commit | c154cd7dd54c2a9b2aed5b1e670d91a7db84600f (patch) | |
tree | 853f9f29774c29335d28afbd910bd227ceac12b6 /src | |
parent | dc9d5657abbddc840c1e73bff7748bde4ff39449 (diff) | |
download | pfsense-c154cd7dd54c2a9b2aed5b1e670d91a7db84600f.zip pfsense-c154cd7dd54c2a9b2aed5b1e670d91a7db84600f.tar.gz |
Services / DNS Resolver / General Settings
Echoing $pconfig['custom_options'] directly into JavaScript is prone to breaking the script by creating invalid syntax due to characters such as line feeds etc.
Best to transfer a flag from PHP.
Diffstat (limited to 'src')
-rw-r--r-- | src/usr/local/www/services_unbound.php | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/usr/local/www/services_unbound.php b/src/usr/local/www/services_unbound.php index 7b5597f..8480b4a 100644 --- a/src/usr/local/www/services_unbound.php +++ b/src/usr/local/www/services_unbound.php @@ -221,6 +221,12 @@ if ($_POST) { } } +if ($pconfig['custom_options']) { + $customoptions = true; +} else { + $customoptions = false; +} + if ($_GET['act'] == "del") { if ($_GET['type'] == 'host') { if ($a_hosts[$_GET['id']]) { @@ -400,10 +406,11 @@ events.push(function() { var text; // On page load decide the initial state based on the data. if (ispageload) { - if ('<?=$pconfig['custom_options']?>' == '') { - showadvcustom = false; - } else { + var customoptions = "<?=$customoptions?>"; + if (customoptions) { showadvcustom = true; + } else { + showadvcustom = false; } } else { // It was a click, swap the state. |