Commit e9d0bd1a authored by Ad Schellevis's avatar Ad Schellevis Committed by Franco Fichtner

(legacy) fix for PHP Warning: in_array() expects parameter 2 to be array,...

(legacy) fix for PHP Warning:  in_array() expects parameter 2 to be array, null given in /usr/local/www/interfaces_bridge_edit.php on line 605

(cherry picked from commit 2ed6e9b1)
parent 87317f8f
......@@ -259,7 +259,7 @@ $(document).ready(function() {
<select name="members[]" multiple="multiple" class="selectpicker" data-size="5" data-live-search="true">
<?php
foreach ($ifacelist 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\"" : "";?>>
<?=$ifinfo;?>
</option>
<?php
......@@ -330,7 +330,7 @@ $(document).ready(function() {
<select name="stp[]" class="selectpicker" multiple="multiple" size="3" data-live-search="true">
<?php
foreach ($ifacelist as $ifn => $ifdescr):?>
<option value="<?$ifn;?>" <?=in_array($ifn, $pconfig['stp']) ? "selected=\"selected\"" : "";?> >
<option value="<?$ifn;?>" <?=!empty($pconfig['stp']) && in_array($ifn, $pconfig['stp']) ? "selected=\"selected\"" : "";?> >
<?=$ifdescr;?>
</option>
<?php
......@@ -503,7 +503,7 @@ $(document).ready(function() {
<select name="edge[]" class="selectpicker" multiple="multiple" size="3" data-live-search="true">
<?php
foreach ($ifacelist as $ifn => $ifdescr):?>
<option value="<?=$ifn;?>" <?=in_array($ifn, $pconfig['edge']) ? "selected=\"selected\"" : "";?>>
<option value="<?=$ifn;?>" <?=!empty($pconfig['edge']) && in_array($ifn, $pconfig['edge']) ? "selected=\"selected\"" : "";?>>
<?=$ifdescr;?>
</option>
<?php
......@@ -522,7 +522,7 @@ $(document).ready(function() {
<select name="autoedge[]" class="selectpicker" multiple="multiple" size="3" data-live-search="true">
<?php
foreach ($ifacelist as $ifn => $ifdescr):?>
<option value="<?=$ifn;?>" <?=in_array($ifn, $pconfig['autoedge']) ? "selected=\"selected\"" : "";?>>
<option value="<?=$ifn;?>" <?=!empty($pconfig['autoedge']) && in_array($ifn, $pconfig['autoedge']) ? "selected=\"selected\"" : "";?>>
<?=$ifdescr;?>
</option>
<?php
......@@ -542,7 +542,7 @@ $(document).ready(function() {
<select name="ptp[]" class="selectpicker" multiple="multiple" size="3" data-live-search="true">
<?php
foreach ($ifacelist as $ifn => $ifdescr):?>
<option value="<?=$ifn;?>" <?=in_array($ifn, $pconfig['ptp']) ? "selected=\"selected\"" : "";?>>
<option value="<?=$ifn;?>" <?=!empty($pconfig['ptp']) && in_array($ifn, $pconfig['ptp']) ? "selected=\"selected\"" : "";?>>
<?=$ifdescr;?>
</option>
<?php
......@@ -561,7 +561,7 @@ $(document).ready(function() {
<select name="autoptp[]" class="selectpicker" multiple="multiple" size="3" data-live-search="true">
<?php
foreach ($ifacelist as $ifn => $ifdescr):?>
<option value="<?=$ifn;?>" <?=in_array($ifn, $pconfig['autoptp']) ? "selected=\"selected\"" : "";?>>
<option value="<?=$ifn;?>" <?=!empty($pconfig['autoptp']) && in_array($ifn, $pconfig['autoptp']) ? "selected=\"selected\"" : "";?>>
<?=$ifdescr;?>
</option>
<?php
......@@ -582,7 +582,7 @@ $(document).ready(function() {
<select name="static[]" class="selectpicker" multiple="multiple" size="3" data-live-search="true">
<?php
foreach ($ifacelist as $ifn => $ifdescr):?>
<option value="<?=$ifn;?>" <?=in_array($ifn, $pconfig['static']) ? "selected=\"selected\"" : "";?>>
<option value="<?=$ifn;?>" <?=!empty($pconfig['static']) && in_array($ifn, $pconfig['static']) ? "selected=\"selected\"" : "";?>>
<?=$ifdescr;?>
</option>
<?php
......@@ -602,7 +602,7 @@ $(document).ready(function() {
<select name="private[]" class="selectpicker" multiple="multiple" size="3" data-live-search="true">
<?php
foreach ($ifacelist as $ifn => $ifdescr):?>
<option value="<?=$ifn;?>" <?=in_array($ifn, $pconfig['private']) ? "selected=\"selected\"" : "";?>>
<option value="<?=$ifn;?>" <?=!empty($pconfig['private']) && in_array($ifn, $pconfig['private']) ? "selected=\"selected\"" : "";?>>
<?=$ifdescr;?>
</option>
<?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