Skip to content

Commit 4375f79

Browse files
Merge pull request hestiacp#802 from kondurake/patch-4
Fix "Parsing error" if a NAT IP is specified
2 parents e6d6e19 + d7f4bc4 commit 4375f79

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

web/templates/admin/add_web.html

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,10 @@
6262
<td>
6363
<select class="vst-list" name="v_ip">
6464
<?php
65-
foreach ($ips as $key => $value) {
66-
$display_ip = $key;
67-
if (!empty($value['NAT'])) $display_ip = $value['NAT'];
68-
echo "\t\t\t\t<option value=\"".htmlentities($display_ip)."\"";
69-
if ((!empty($v_ip)) && ( $display_ip == $_POST['v_ip'])){
70-
echo ' selected';
71-
}
72-
echo ">".htmlentities($display_ip)."</option>\n";
65+
foreach ($ips as $ip => $value) {
66+
$display_ip = htmlentities(empty($value['NAT']) ? $ip : "{$ip} → {$value['NAT']}");
67+
$ip_selected = (!empty($v_ip) && $ip == $_POST['v_ip']) ? 'selected' : '';
68+
echo "\t\t\t\t<option value=\"{$ip}\" {$ip_selected}>{$display_ip}</option>\n";
7369
}
7470
?>
7571
</select>

0 commit comments

Comments
 (0)