Fix column selection issue

This commit is contained in:
ruan 2016-07-06 17:35:40 +02:00
parent 2d519f6396
commit 1eba03cc29

View File

@ -137,10 +137,13 @@ class Page {
// Under certain versions of PHP, there is a bug with BIT columns. // Under certain versions of PHP, there is a bug with BIT columns.
// An empty string is returned no matter what the value is. // An empty string is returned no matter what the value is.
// Workaround: cast to unsigned. // Workaround: cast to unsigned.
$selection = "id,uuid,reason,banned_by_name,banned_by_uuid,removed_by_name,time,until,CAST(active AS UNSIGNED) AS active"; $selection = "id,uuid,reason,banned_by_name,banned_by_uuid,time,until,CAST(active AS UNSIGNED) AS active";
if ($table === $this->settings->table['warnings']) { if ($table === $this->settings->table['warnings']) {
$selection .= ",CAST(warned AS UNSIGNED) AS warned"; $selection .= ",CAST(warned AS UNSIGNED) AS warned";
} }
if ($table !== $this->settings->table['kicks']) {
$selection .= "removed_by_name";
}
return $selection; return $selection;
} }