diff options
| author | czaks <marcin@6irc.net> | 2014-04-20 23:33:52 +0200 |
|---|---|---|
| committer | czaks <marcin@6irc.net> | 2014-04-20 23:33:52 +0200 |
| commit | 0ec63553588bc82f27d8052c79b4100ed8f86db5 (patch) | |
| tree | 8fd7611cc2a5c51341e224eda3a84631e0af3288 | |
| parent | d25db31860c73d73d1d0b097a4162ffbdfd20398 (diff) | |
fix recentposts theme building null query, throw error instead
| -rw-r--r-- | templates/themes/recent/theme.php | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/templates/themes/recent/theme.php b/templates/themes/recent/theme.php index 4bbf1469..26a9a69b 100644 --- a/templates/themes/recent/theme.php +++ b/templates/themes/recent/theme.php @@ -45,6 +45,11 @@ $query .= sprintf("SELECT *, '%s' AS `board` FROM ``posts_%s`` WHERE `file` IS NOT NULL AND `file` != 'deleted' AND `thumb` != 'spoiler' UNION ALL ", $_board['uri'], $_board['uri']); } $query = preg_replace('/UNION ALL $/', 'ORDER BY `time` DESC LIMIT ' . (int)$settings['limit_images'], $query); + + if ($query == '') { + error(_("Can't build the RecentPosts theme, because there are no boards to be fetched.")); + } + $query = query($query) or error(db_error()); while ($post = $query->fetch(PDO::FETCH_ASSOC)) { |
