mirror of
https://gitlab.com/ruany/litebans-php.git
synced 2025-05-24 08:52:45 +00:00
Looks like the PHP bug applies at random across multiple versions
This commit is contained in:
parent
a72ed2faf0
commit
1a37b1a87c
@ -92,18 +92,14 @@ class Page {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function get_selection($table) {
|
function get_selection($table) {
|
||||||
if (version_compare(PHP_VERSION, '5.4.0') >= 0) {
|
// Under certain versions of PHP, there is a bug with BIT columns.
|
||||||
$selection = "*";
|
// An empty string is returned no matter what the value is.
|
||||||
} else {
|
// Workaround: cast to unsigned.
|
||||||
// PDO+MySQL under PHP 5.3.x has a bug with BIT columns.
|
$selection = "id,uuid,reason,banned_by_name,banned_by_uuid,time,until,CAST(active AS UNSIGNED) AS active";
|
||||||
// An empty string is returned no matter what the value is.
|
if ($table === $this->settings->table['warnings']) {
|
||||||
// Workaround: cast to unsigned.
|
$selection .= ",CAST(warned AS UNSIGNED) AS warned";
|
||||||
$selection = "id,uuid,reason,banned_by_name,banned_by_uuid,time,until,CAST(active AS UNSIGNED) AS active";
|
return $selection;
|
||||||
if ($table === $this->settings->table['warnings']) {
|
|
||||||
$selection .= ",CAST(warned AS UNSIGNED) AS warned";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return $selection;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function run_query() {
|
function run_query() {
|
||||||
@ -239,7 +235,8 @@ class Page {
|
|||||||
* @param row
|
* @param row
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function expiry($row) {
|
public
|
||||||
|
function expiry($row) {
|
||||||
if ($this->type === "kick") {
|
if ($this->type === "kick") {
|
||||||
return "N/A";
|
return "N/A";
|
||||||
}
|
}
|
||||||
@ -369,11 +366,13 @@ class Page {
|
|||||||
include_once './includes/footer.php';
|
include_once './includes/footer.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function table_begin() {
|
public
|
||||||
|
function table_begin() {
|
||||||
echo '<table class="table table-striped table-bordered table-condensed">';
|
echo '<table class="table table-striped table-bordered table-condensed">';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function table_end($clicky = true) {
|
public
|
||||||
|
function table_end($clicky = true) {
|
||||||
echo '</table>';
|
echo '</table>';
|
||||||
if ($clicky) {
|
if ($clicky) {
|
||||||
echo "<script type=\"text/javascript\">withjQuery(function(){ $('tr').click(function(){var href=$(this).find('a').attr('href');if(href!==undefined)window.location=href;}).hover(function(){\$(this).toggleClass('hover');}); });</script>";
|
echo "<script type=\"text/javascript\">withjQuery(function(){ $('tr').click(function(){var href=$(this).find('a').attr('href');if(href!==undefined)window.location=href;}).hover(function(){\$(this).toggleClass('hover');}); });</script>";
|
||||||
@ -383,7 +382,8 @@ class Page {
|
|||||||
/**
|
/**
|
||||||
* @param $info
|
* @param $info
|
||||||
*/
|
*/
|
||||||
public function set_info($info) {
|
public
|
||||||
|
function set_info($info) {
|
||||||
$this->type = $info['type'];
|
$this->type = $info['type'];
|
||||||
$this->table = $info['table'];
|
$this->table = $info['table'];
|
||||||
$this->title = $info['title'];
|
$this->title = $info['title'];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user