Skip to content

Commit cfcc7d6

Browse files
authored
Fix "Parsing error" if a NAT IP is specified
https://bugs.vestacp.com/issues/325
1 parent e6d6e19 commit cfcc7d6

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

web/templates/admin/edit_web.html

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,10 @@
6565
<td>
6666
<select class="vst-list" name="v_ip">
6767
<?php
68-
foreach ($ips as $key => $value) {
69-
$display_ip = $key;
70-
if (!empty($value['NAT'])) $display_ip = $value['NAT'];
71-
$skey = "'".$display_ip."'";
72-
echo "\n\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"".htmlentities($display_ip)."\"";
73-
if ((!empty($v_ip)) && ( $display_ip == $v_ip ) || ( $skey == $v_ip )){
74-
echo ' selected';
75-
}
76-
echo ">".htmlentities($display_ip)."</option>\n";
68+
foreach ($ips as $ip => $value) {
69+
$display_ip = htmlentities(empty($value['NAT']) ? $ip : "{$ip} → {$value['NAT']}");
70+
$ip_selected = ((!empty($v_ip) && $ip == $v_ip) || $v_ip == "'{$ip}'") ? 'selected' : '';
71+
echo "\n\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"{$ip}\" {$ip_selected}>{$display_ip}</option>\n";
7772
}
7873
?>
7974
</select>

0 commit comments

Comments
 (0)