From ec48432a9434e13850d274795935460fa8e0ae2f Mon Sep 17 00:00:00 2001 From: ruan Date: Thu, 24 Sep 2015 09:30:08 +0200 Subject: [PATCH] Possible fix for expired bans with PHP <=5.3 --- includes/page.php | 7 ++++++- info.php | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/includes/page.php b/includes/page.php index ee39b21..2ad05ad 100644 --- a/includes/page.php +++ b/includes/page.php @@ -220,7 +220,7 @@ class Page { } else { $until = $this->millis_to_date($row['until']); } - if ($this->settings->show_inactive_bans && !$row['active']) { + if ($this->settings->show_inactive_bans && $this->active($row) === false) { $until .= ' ' . $this->expired[$this->type]; } return $until; @@ -353,4 +353,9 @@ class Page { $this->table = $info['table']; $this->title = $info['title']; } + + public function active($row) { + $active = $row['active']; + return $active === 1 || $active === true; + } } diff --git a/info.php b/info.php index 983413d..c626edc 100644 --- a/info.php +++ b/info.php @@ -150,7 +150,7 @@ if ($st->execute(array($id))) { $name = $info->name(); $permanent = $info->permanent(); - $active = $row['active']; + $active = $page->active($row); $page->name = "$name #$id"; $page->print_title();