Fix PM count caching.
cache::get() returns null if the key wasn't found (at least when using the Redis cache backend).
This commit is contained in:
parent
fd33e9eba1
commit
3bcc87caf2
@ -125,7 +125,7 @@ if (isset($_COOKIE[$config['cookies']['mod']])) {
|
|||||||
function create_pm_header() {
|
function create_pm_header() {
|
||||||
global $mod, $config;
|
global $mod, $config;
|
||||||
|
|
||||||
if ($config['cache']['enabled'] && ($header = cache::get('pm_unread_' . $mod['id'])) !== false) {
|
if ($config['cache']['enabled'] && ($header = cache::get('pm_unread_' . $mod['id'])) != false) {
|
||||||
if ($header === true)
|
if ($header === true)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -89,7 +89,7 @@ function mod_dashboard() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$config['cache']['enabled'] || ($args['unread_pms'] = cache::get('pm_unreadcount_' . $mod['id'])) === false) {
|
if (!$config['cache']['enabled'] || ($args['unread_pms'] = cache::get('pm_unreadcount_' . $mod['id'])) == false) {
|
||||||
$query = prepare('SELECT COUNT(*) FROM `pms` WHERE `to` = :id AND `unread` = 1');
|
$query = prepare('SELECT COUNT(*) FROM `pms` WHERE `to` = :id AND `unread` = 1');
|
||||||
$query->bindValue(':id', $mod['id']);
|
$query->bindValue(':id', $mod['id']);
|
||||||
$query->execute() or error(db_error($query));
|
$query->execute() or error(db_error($query));
|
||||||
|
Loading…
Reference in New Issue
Block a user