fix problem with html select containing 0 as key

This commit is contained in:
msquare 2017-07-23 12:09:42 +02:00
parent 908f5712cc
commit 4d08434d31
1 changed files with 1 additions and 1 deletions

View File

@ -405,7 +405,7 @@ function html_select_key($dom_id, $name, $rows, $selected)
{
$html = '<select class="form-control" id="' . $dom_id . '" name="' . $name . '">';
foreach ($rows as $key => $row) {
if (($key == $selected) || ($row == $selected)) {
if (($key == $selected) || ($row === $selected)) {
$html .= '<option value="' . $key . '" selected="selected">' . $row . '</option>';
} else {
$html .= '<option value="' . $key . '">' . $row . '</option>';