aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/include/search/main.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/core/include/search/main.php b/core/include/search/main.php
index 14c2ac9..9e7c0a7 100644
--- a/core/include/search/main.php
+++ b/core/include/search/main.php
@@ -27,8 +27,12 @@ if($search = HTTP::GET('q')) {
'year' => HTTP::GET('y')
];
- if(!$posts = $PostRepository->search($search, $filter, $site_size, $offset)) {
- $message = $Language->text('search_no_results', escapeHTML($search));
+ try {
+ if (!$posts = $PostRepository->search($search, $filter, $site_size, $offset)) {
+ $message = $Language->text('search_no_results', escapeHTML($search));
+ }
+ } catch(PDOException $Exception) {
+ $message = $Exception->getMessage();
}
}