Skip to content

Commit

Permalink
Do not print JS when there are input errors on diag_dns.php; fix json…
Browse files Browse the repository at this point in the history
…_encode syntax. Ticket #7999
  • Loading branch information
jim-p committed Oct 27, 2017
1 parent fd0d84e commit f32e953
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/usr/local/www/diag_dns.php
Expand Up @@ -333,11 +333,12 @@ function display_host_results ($address, $hostname, $dns_speeds) {
</div>
<?php
}
if (!$input_errors):
?>
<script type="text/javascript">
//<![CDATA[
events.push(function() {
var original_host = "<?=json_encode($host);?>";
var original_host = <?=json_encode($host);?>;

$('input[name="host"]').on('input', function() {
if ($('#host').val() == original_host) {
Expand All @@ -350,4 +351,5 @@ function display_host_results ($address, $hostname, $dns_speeds) {
//]]>
</script>
<?php
endif;
include("foot.inc");

0 comments on commit f32e953

Please sign in to comment.