From 6f624991606906461454062052ef2b7df86b014b Mon Sep 17 00:00:00 2001 From: Michael Foster Date: Mon, 9 Sep 2013 19:19:11 +1000 Subject: [PATCH] Bugfix: Undefined $cached (when caching is disabled) --- inc/functions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inc/functions.php b/inc/functions.php index e5e33449..f19e00ae 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -1082,10 +1082,10 @@ function index($page, $mod=false) { $replies = $cached['replies']; $omitted = $cached['omitted']; } else { - $cached = false; + unset($cached); } } - if (!$cached) { + if (!isset($cached)) { $posts = prepare(sprintf("SELECT * FROM ``posts_%s`` WHERE `thread` = :id ORDER BY `id` DESC LIMIT :limit", $board['uri'])); $posts->bindValue(':id', $th['id']); $posts->bindValue(':limit', ($th['sticky'] ? $config['threads_preview_sticky'] : $config['threads_preview']), PDO::PARAM_INT);