mirror of
https://github.com/vrana/adminer.git
synced 2025-11-18 11:00:40 +01:00
not_vals in optionlist() is always true
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@147 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
@@ -12,15 +12,15 @@ function bracket_escape($idf, $back = false) {
|
||||
return strtr($idf, ($back ? array_flip($trans) : $trans));
|
||||
}
|
||||
|
||||
function optionlist($options, $selected = array(), $not_vals = false) {
|
||||
function optionlist($options, $selected = array()) {
|
||||
$return = "";
|
||||
foreach ($options as $k => $v) {
|
||||
if (is_array($v)) {
|
||||
$return .= '<optgroup label="' . htmlspecialchars($k) . '">';
|
||||
}
|
||||
foreach ((is_array($v) ? $v : array($k => $v)) as $key => $val) {
|
||||
$checked = in_array(($not_vals ? $val : $key), (array) $selected, true);
|
||||
$return .= '<option' . ($not_vals ? '' : ' value="' . htmlspecialchars($key) . '"') . ($checked ? ' selected="selected"' : '') . '>' . htmlspecialchars($val) . '</option>';
|
||||
$checked = in_array($val, (array) $selected, true);
|
||||
$return .= '<option' . ($checked ? ' selected="selected"' : '') . '>' . htmlspecialchars($val) . '</option>';
|
||||
}
|
||||
if (is_array($v)) {
|
||||
$return .= '</optgroup>';
|
||||
|
||||
Reference in New Issue
Block a user