Commit 31952088 authored by Franco Fichtner's avatar Franco Fichtner

interfaces: fix a crash report in LAGG edit page

parent ebd02c22
...@@ -109,9 +109,11 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -109,9 +109,11 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
do_input_validation($pconfig, $reqdfields, $reqdfieldsn, $input_errors); do_input_validation($pconfig, $reqdfields, $reqdfieldsn, $input_errors);
foreach ($pconfig['members'] as $member) { if (isset($pconfig['members'])) {
if (!does_interface_exist($member)) { foreach ($pconfig['members'] as $member) {
$input_errors[] = gettext("Interface supplied as member is invalid"); if (!does_interface_exist($member)) {
$input_errors[] = sprintf(gettext('Interface \'%s\' supplied as member does not exist'), $member);
}
} }
} }
...@@ -182,7 +184,7 @@ legacy_html_escape_form_data($pconfig); ...@@ -182,7 +184,7 @@ legacy_html_escape_form_data($pconfig);
<select name="members[]" multiple="multiple" class="selectpicker"> <select name="members[]" multiple="multiple" class="selectpicker">
<?php <?php
foreach (available_interfaces(isset($id) ? $id : null) as $ifn => $ifinfo):?> foreach (available_interfaces(isset($id) ? $id : null) as $ifn => $ifinfo):?>
<option value="<?=$ifn;?>" <?=in_array($ifn, $pconfig['members']) ? "selected=\"selected\"" : "";?>> <option value="<?=$ifn;?>" <?=!empty($pconfig['members']) && in_array($ifn, $pconfig['members']) ? "selected=\"selected\"" : "";?>>
<?=$ifn;?> (<?=$ifinfo['mac']?>) <?=$ifn;?> (<?=$ifinfo['mac']?>)
</option> </option>
<?php <?php
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment