commit a44981a32a57a87714d9fac21f37a87032623874
Author: Colin Fleming <cj_fleming@sky.com>
Date:   Wed May 1 19:25:54 2013 +0100

    Tidy up "firewall_nat_1to1_edit" XHTML
    
    Add CDATA section to SCRIPT tag
    Close BR and INPUT tags
    Update HTML Boolean operators
    Add missing closing TD tag

diff --git a/usr/local/www/firewall_nat_1to1_edit.php b/usr/local/www/firewall_nat_1to1_edit.php
index 371db9cf4f..b0bdbb8d98 100755
--- a/usr/local/www/firewall_nat_1to1_edit.php
+++ b/usr/local/www/firewall_nat_1to1_edit.php
@@ -224,11 +224,10 @@ include("head.inc");
 ?>
 
 <body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<script type="text/javascript" src="/javascript/suggestions.js">
-</script>
-<script type="text/javascript" src="/javascript/autosuggest.js">
-</script>
+<script type="text/javascript" src="/javascript/suggestions.js"></script>
+<script type="text/javascript" src="/javascript/autosuggest.js"></script>
 <script type="text/javascript">
+//<![CDATA[
 function typesel_change() {
         switch (document.iform.srctype.selectedIndex) {
                 case 1: /* single */
@@ -265,22 +264,24 @@ function typesel_change() {
 			break;
         }
 }
+//]]>
 </script>
 
 <?php include("fbegin.inc"); ?>
 <?php if ($input_errors) print_input_errors($input_errors); ?>
             <form action="firewall_nat_1to1_edit.php" method="post" name="iform" id="iform">
-              <table width="100%" border="0" cellpadding="6" cellspacing="0">
+              <table width="100%" border="0" cellpadding="6" cellspacing="0" summary="firewall nat 1to1 edit">
 				<tr>
 					<td colspan="2" valign="top" class="listtopic"><?=gettext("Edit NAT 1:1 entry"); ?></td>
 				</tr>	
 		<tr>
                         <td width="22%" valign="top" class="vncellreq"><?=gettext("Disabled"); ?></td>
                         <td width="78%" class="vtable">
-                                <input name="disabled" type="checkbox" id="disabled" value="yes" <?php if ($pconfig['disabled']) echo "checked"; ?>>
+                                <input name="disabled" type="checkbox" id="disabled" value="yes" <?php if ($pconfig['disabled']) echo "checked=\"checked\""; ?> />
                                 <strong><?=gettext("Disable this rule"); ?></strong><br />
                                 <span class="vexpl"><?=gettext("Set this option to disable this rule without removing it from the list."); ?></span>
-		</td>
+                        </td>
+		</tr>
 		<tr>
 			  <td width="22%" valign="top" class="vncellreq"><?=gettext("Interface"); ?></td>
 			  <td width="78%" class="vtable">
@@ -312,56 +313,56 @@ function typesel_change() {
 
 					foreach ($interfaces as $iface => $ifacename): 
 					?>
-					<option value="<?=$iface;?>" <?php if ($iface == $pconfig['interface']) echo "selected"; ?>>
+					<option value="<?=$iface;?>" <?php if ($iface == $pconfig['interface']) echo "selected=\"selected\""; ?>>
 					<?=htmlspecialchars($ifacename);?>
 					</option>
 					<?php endforeach; ?>
-				</select><br>
-			  <span class="vexpl"><?=gettext("Choose which interface this rule applies to"); ?>.<br>
+				</select><br/>
+			  <span class="vexpl"><?=gettext("Choose which interface this rule applies to"); ?>.<br/>
 			  <?=gettext("Hint: in most cases, you'll want to use WAN here"); ?>.</span></td>
 		</tr>
                 <tr> 
                   <td width="22%" valign="top" class="vncellreq"><?=gettext("External subnet IP"); ?></td>
                   <td width="78%" class="vtable"> 
-                    <input name="external" type="text" class="formfld" id="external" size="20" value="<?=htmlspecialchars($pconfig['external']);?>"> 
+                    <input name="external" type="text" class="formfld" id="external" size="20" value="<?=htmlspecialchars($pconfig['external']);?>" /> 
                     <br/>
-                    <span class="vexpl"><?=gettext("Enter the external (usually on a WAN) subnet's starting address for the 1:1 mapping.  The subnet mask from the internal address below will be applied to this IP address."); ?><br>
+                    <span class="vexpl"><?=gettext("Enter the external (usually on a WAN) subnet's starting address for the 1:1 mapping.  The subnet mask from the internal address below will be applied to this IP address."); ?><br/>
                     <?=gettext("Hint: this is generally an address owned by the router itself on the selected interface."); ?></span>
 			</td>
                 </tr>
 		<tr>
                         <td width="22%" valign="top" class="vncellreq"><?=gettext("Internal IP"); ?></td>
                         <td width="78%" class="vtable">
-                                <input name="srcnot" type="checkbox" id="srcnot" value="yes" <?php if ($pconfig['srcnot']) echo "checked"; ?>>
+                                <input name="srcnot" type="checkbox" id="srcnot" value="yes" <?php if ($pconfig['srcnot']) echo "checked=\"checked\""; ?> />
                                 <strong><?=gettext("not"); ?></strong>
                                 <br />
                                 <?=gettext("Use this option to invert the sense of the match."); ?>
                                 <br />
                                 <br />
-                                <table border="0" cellspacing="0" cellpadding="0">
+                                <table border="0" cellspacing="0" cellpadding="0" summary="source">
                                         <tr>
                                                 <td><?=gettext("Type:"); ?>&nbsp;&nbsp;</td>
                                                 <td>
-                                                        <select name="srctype" class="formselect" onChange="typesel_change()">
+                                                        <select name="srctype" class="formselect" onchange="typesel_change()">
 <?php
                                                                 $sel = is_specialnet($pconfig['src']); ?>
-                                                                <option value="any"     <?php if ($pconfig['src'] == "any") { echo "selected"; } ?>><?=gettext("any"); ?></option>
-                                                                <option value="single"  <?php if ((($pconfig['srcmask'] == 32) || !isset($pconfig['srcmask'])) && !$sel) { echo "selected"; $sel = 1; } ?>><?=gettext("Single host"); ?></option>
-                                                                <option value="network" <?php if (!$sel) echo "selected"; ?>><?=gettext("Network"); ?></option>
+                                                                <option value="any"     <?php if ($pconfig['src'] == "any") { echo "selected=\"selected\""; } ?>><?=gettext("any"); ?></option>
+                                                                <option value="single"  <?php if ((($pconfig['srcmask'] == 32) || !isset($pconfig['srcmask'])) && !$sel) { echo "selected=\"selected\""; $sel = 1; } ?>><?=gettext("Single host"); ?></option>
+                                                                <option value="network" <?php if (!$sel) echo "selected=\"selected\""; ?>><?=gettext("Network"); ?></option>
                                                                 <?php if(have_ruleint_access("pptp")): ?>
-                                                                <option value="pptp"    <?php if ($pconfig['src'] == "pptp") { echo "selected"; } ?>><?=gettext("PPTP clients"); ?></option>
+                                                                <option value="pptp"    <?php if ($pconfig['src'] == "pptp") { echo "selected=\"selected\""; } ?>><?=gettext("PPTP clients"); ?></option>
                                                                 <?php endif; ?>
                                                                 <?php if(have_ruleint_access("pppoe")): ?>
-                                                                <option value="pppoe"   <?php if ($pconfig['src'] == "pppoe") { echo "selected"; } ?>><?=gettext("PPPoE clients"); ?></option>
+                                                                <option value="pppoe"   <?php if ($pconfig['src'] == "pppoe") { echo "selected=\"selected\""; } ?>><?=gettext("PPPoE clients"); ?></option>
                                                                 <?php endif; ?>
                                                                  <?php if(have_ruleint_access("l2tp")): ?>
-                                                                <option value="l2tp"   <?php if ($pconfig['src'] == "l2tp") { echo "selected"; } ?>><?=gettext("L2TP clients"); ?></option>
+                                                                <option value="l2tp"   <?php if ($pconfig['src'] == "l2tp") { echo "selected=\"selected\""; } ?>><?=gettext("L2TP clients"); ?></option>
                                  <?php endif; ?>
 <?php
                                                                 foreach ($ifdisp as $ifent => $ifdesc): ?>
                                                                 <?php if(have_ruleint_access($ifent)): ?>
-                                                                        <option value="<?=$ifent;?>" <?php if ($pconfig['src'] == $ifent) { echo "selected"; } ?>><?=htmlspecialchars($ifdesc);?> <?=gettext("subnet"); ?></option>
-                                                                        <option value="<?=$ifent;?>ip"<?php if ($pconfig['src'] ==  $ifent . "ip") { echo "selected"; } ?>>
+                                                                        <option value="<?=$ifent;?>" <?php if ($pconfig['src'] == $ifent) { echo "selected=\"selected\""; } ?>><?=htmlspecialchars($ifdesc);?> <?=gettext("subnet"); ?></option>
+                                                                        <option value="<?=$ifent;?>ip"<?php if ($pconfig['src'] ==  $ifent . "ip") { echo "selected=\"selected\""; } ?>>
                                                                                 <?=$ifdesc?> <?=gettext("address");?>
                                                                         </option>
                                                                 <?php endif; endforeach; ?>
@@ -371,10 +372,10 @@ function typesel_change() {
                                         <tr>
                                                 <td><?=gettext("Address:"); ?>&nbsp;&nbsp;</td>
                                                 <td>
-                                                        <input name="src" type="text" class="formfld" id="src" size="20" value="<?php if (!is_specialnet($pconfig['src'])) echo htmlspecialchars($pconfig['src']);?>"> /
+                                                        <input name="src" type="text" class="formfld" id="src" size="20" value="<?php if (!is_specialnet($pconfig['src'])) echo htmlspecialchars($pconfig['src']);?>" /> /
                                                         <select name="srcmask" class="formselect" id="srcmask">
 <?php                                           for ($i = 31; $i > 0; $i--): ?>
-                                                        <option value="<?=$i;?>" <?php if ($i == $pconfig['srcmask']) echo "selected"; ?>><?=$i;?></option>
+                                                        <option value="<?=$i;?>" <?php if ($i == $pconfig['srcmask']) echo "selected=\"selected\""; ?>><?=$i;?></option>
 <?php                                           endfor; ?>
                                                         </select>
                                                 </td>
@@ -387,36 +388,36 @@ function typesel_change() {
 		<tr>
                         <td width="22%" valign="top" class="vncellreq"><?=gettext("Destination"); ?></td>
                         <td width="78%" class="vtable">
-                                <input name="dstnot" type="checkbox" id="dstnot" value="yes" <?php if ($pconfig['dstnot']) echo "checked"; ?>>
+                                <input name="dstnot" type="checkbox" id="dstnot" value="yes" <?php if ($pconfig['dstnot']) echo "checked=\"checked\""; ?> />
                                 <strong><?=gettext("not"); ?></strong>
                                         <br />
                                 <?=gettext("Use this option to invert the sense of the match."); ?>
                                         <br />
                                         <br />
-                                <table border="0" cellspacing="0" cellpadding="0">
+                                <table border="0" cellspacing="0" cellpadding="0" summary="destination">
                                         <tr>
                                                 <td><?=gettext("Type:"); ?>&nbsp;&nbsp;</td>
                                                 <td>
-                                                        <select name="dsttype" class="formselect" onChange="typesel_change()">
+                                                        <select name="dsttype" class="formselect" onchange="typesel_change()">
 <?php
                                                                 $sel = is_specialnet($pconfig['dst']); ?>
-                                                                <option value="any" <?php if (empty($pconfig['dst']) || $pconfig['dst'] == "any") { echo "selected"; } ?>><?=gettext("any"); ?></option>
-                                                                <option value="single" <?php if (($pconfig['dstmask'] == 32) && !$sel) { echo "selected"; $sel = 1; } ?>><?=gettext("Single host or alias"); ?></option>
-                                                                <option value="network" <?php if (!$sel && !empty($pconfig['dst'])) echo "selected"; ?>><?=gettext("Network"); ?></option>
+                                                                <option value="any" <?php if (empty($pconfig['dst']) || $pconfig['dst'] == "any") { echo "selected=\"selected\""; } ?>><?=gettext("any"); ?></option>
+                                                                <option value="single" <?php if (($pconfig['dstmask'] == 32) && !$sel) { echo "selected=\"selected\""; $sel = 1; } ?>><?=gettext("Single host or alias"); ?></option>
+                                                                <option value="network" <?php if (!$sel && !empty($pconfig['dst'])) echo "selected=\"selected\""; ?>><?=gettext("Network"); ?></option>
                                                                 <?php if(have_ruleint_access("pptp")): ?>
-                                                                <option value="pptp" <?php if ($pconfig['dst'] == "pptp") { echo "selected"; } ?>><?=gettext("PPTP clients"); ?></option>
+                                                                <option value="pptp" <?php if ($pconfig['dst'] == "pptp") { echo "selected=\"selected\""; } ?>><?=gettext("PPTP clients"); ?></option>
                                                                 <?php endif; ?>
                                                                 <?php if(have_ruleint_access("pppoe")): ?>
-                                                                <option value="pppoe" <?php if ($pconfig['dst'] == "pppoe") { echo "selected"; } ?>><?=gettext("PPPoE clients"); ?></option>
+                                                                <option value="pppoe" <?php if ($pconfig['dst'] == "pppoe") { echo "selected=\"selected\""; } ?>><?=gettext("PPPoE clients"); ?></option>
                                                                 <?php endif; ?>
                                                                 <?php if(have_ruleint_access("l2tp")): ?>
-                                                                <option value="l2tp" <?php if ($pconfig['dst'] == "l2tp") { echo "selected"; } ?>><?=gettext("L2TP clients"); ?></option>
+                                                                <option value="l2tp" <?php if ($pconfig['dst'] == "l2tp") { echo "selected=\"selected\""; } ?>><?=gettext("L2TP clients"); ?></option>
                                                                 <?php endif; ?>
 
 <?php                                                   foreach ($ifdisp as $if => $ifdesc): ?>
                                                                 <?php if(have_ruleint_access($if)): ?>
-                                                                        <option value="<?=$if;?>" <?php if ($pconfig['dst'] == $if) { echo "selected"; } ?>><?=htmlspecialchars($ifdesc);?> <?=gettext("subnet"); ?></option>
-                                                                        <option value="<?=$if;?>ip"<?php if ($pconfig['dst'] == $if . "ip") { echo "selected"; } ?>>
+                                                                        <option value="<?=$if;?>" <?php if ($pconfig['dst'] == $if) { echo "selected=\"selected\""; } ?>><?=htmlspecialchars($ifdesc);?> <?=gettext("subnet"); ?></option>
+                                                                        <option value="<?=$if;?>ip"<?php if ($pconfig['dst'] == $if . "ip") { echo "selected=\"selected\""; } ?>>
                                                                                 <?=$ifdesc;?> <?=gettext("address");?>
                                                                         </option>
 <?php							endif; endforeach; ?>
@@ -426,25 +427,26 @@ function typesel_change() {
                                         <tr>
                                                 <td><?=gettext("Address:"); ?>&nbsp;&nbsp;</td>
                                                 <td>
-                                                        <input name="dst" type="text" autocomplete="off" class="formfldalias" id="dst" size="20" value="<?php if (!is_specialnet($pconfig['dst'])) echo htmlspecialchars($pconfig['dst']);?>">
+                                                        <input name="dst" type="text" autocomplete="off" class="formfldalias" id="dst" size="20" value="<?php if (!is_specialnet($pconfig['dst'])) echo htmlspecialchars($pconfig['dst']);?>" />
                                                         /
                                                         <select name="dstmask" class="formselect" id="dstmask">
 <?php
                                                         for ($i = 31; $i > 0; $i--): ?>
-                                                                <option value="<?=$i;?>" <?php if ($i == $pconfig['dstmask']) echo "selected"; ?>><?=$i;?></option>
+                                                                <option value="<?=$i;?>" <?php if ($i == $pconfig['dstmask']) echo "selected=\"selected\""; ?>><?=$i;?></option>
 <?php                                           endfor; ?>
                                                         </select>
                                                 </td>
                                         </tr>
                                 </table>
 			<br/>
-                     <span class="vexpl"><?=gettext("The 1:1 mapping will only be used for connections to or from the specified destination."); ?><br>
+                     <span class="vexpl"><?=gettext("The 1:1 mapping will only be used for connections to or from the specified destination."); ?><br/>
                      <?=gettext("Hint: this is usually 'any'."); ?></span>
+                     </td>
                 </tr>
                 <tr> 
                   <td width="22%" valign="top" class="vncell"><?=gettext("Description"); ?></td>
                   <td width="78%" class="vtable"> 
-                    <input name="descr" type="text" class="formfld unknown" id="descr" size="40" value="<?=htmlspecialchars($pconfig['descr']);?>"> 
+                    <input name="descr" type="text" class="formfld unknown" id="descr" size="40" value="<?=htmlspecialchars($pconfig['descr']);?>" /> 
                     <br/> <span class="vexpl"><?=gettext("You may enter a description here " .
                     "for your reference (not parsed)."); ?></span></td>
                 </tr>
@@ -452,27 +454,29 @@ function typesel_change() {
 			<td width="22%" valign="top" class="vncell"><?=gettext("NAT reflection"); ?></td>
 			<td width="78%" class="vtable">
 				<select name="natreflection" class="formselect">
-					<option value="default" <?php if ($pconfig['natreflection'] != "enable" && $pconfig['natreflection'] != "disable") echo "selected"; ?>><?=gettext("use system default"); ?></option>
-					<option value="enable" <?php if ($pconfig['natreflection'] == "enable") echo "selected"; ?>><?=gettext("enable"); ?></option>
-					<option value="disable" <?php if ($pconfig['natreflection'] == "disable") echo "selected"; ?>><?=gettext("disable"); ?></option>
+					<option value="default" <?php if ($pconfig['natreflection'] != "enable" && $pconfig['natreflection'] != "disable") echo "selected=\"selected\""; ?>><?=gettext("use system default"); ?></option>
+					<option value="enable" <?php if ($pconfig['natreflection'] == "enable") echo "selected=\"selected\""; ?>><?=gettext("enable"); ?></option>
+					<option value="disable" <?php if ($pconfig['natreflection'] == "disable") echo "selected=\"selected\""; ?>><?=gettext("disable"); ?></option>
 				</select>
 			</td>
 		</tr>
                 <tr> 
                   <td width="22%" valign="top">&nbsp;</td>
                   <td width="78%"> 
-                    <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="history.back()" />
                     <?php if (isset($id) && $a_1to1[$id]): ?>
-                    <input name="id" type="hidden" value="<?=htmlspecialchars($id);?>"> 
+                    <input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" />
                     <?php endif; ?>
                   </td>
                 </tr>
               </table>
 </form>
-<script language="JavaScript">
+<script type="text/javascript">
+//<![CDATA[
         typesel_change();
+//]]>
 </script>
-<script language="JavaScript">
+<script type="text/javascript">
 //<![CDATA[
 	var addressarray = <?= json_encode(get_alias_list(array("host", "network", "openvpn", "urltable"))) ?>;
         var oTextbox1 = new AutoSuggestControl(document.getElementById("dst"), new StateSuggestions(addressarray));
