Editor: Fix displaying of false values in PostgreSQL (bug #568)
This commit is contained in:
parent
7b9d5a29aa
commit
0cdd8beab1
|
@ -915,7 +915,7 @@ function input($field, $value, $function) {
|
|||
echo $input;
|
||||
} elseif (preg_match('~bool~', $field["type"])) {
|
||||
echo "<input type='hidden'$attrs value='0'>" .
|
||||
"<input type='checkbox'" . (in_array(strtolower($value), array('1', 't', 'true', 'y', 'yes', 'on')) ? " checked='checked'" : "") . "$attrs value='1'>";
|
||||
"<input type='checkbox'" . (preg_match('~^(1|t|true|y|yes|on)$~i', $value) ? " checked='checked'" : "") . "$attrs value='1'>";
|
||||
} elseif ($field["type"] == "set") { //! 64 bits
|
||||
preg_match_all("~'((?:[^']|'')*)'~", $field["length"], $matches);
|
||||
foreach ($matches[1] as $i => $val) {
|
||||
|
|
|
@ -11,6 +11,7 @@ PostgreSQL: Export DROP SEQUENCE if dropping table
|
|||
MS SQL: Support freetds
|
||||
Elasticsearch: Insert, update, delete
|
||||
MongoDB: Support mongodb PHP extension
|
||||
Editor: Fix displaying of false values in PostgreSQL (bug #568)
|
||||
|
||||
Adminer 4.4.0 (released 2018-01-17):
|
||||
Add Content Security Policy
|
||||
|
|
|
@ -183,7 +183,7 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
|
|||
}
|
||||
}
|
||||
if (like_bool($field) && $return != " ") { // bool
|
||||
$return = ($val ? lang('yes') : lang('no'));
|
||||
$return = (preg_match('~^(1|t|true|y|yes|on)$~i', $value) ? lang('yes') : lang('no'));
|
||||
}
|
||||
if ($link) {
|
||||
$return = "<a href='$link'" . (is_url($link) ? " rel='noreferrer'" : "") . ">$return</a>";
|
||||
|
|
Loading…
Reference in a new issue