aboutsummaryrefslogtreecommitdiffstats
path: root/admin/post
diff options
context:
space:
mode:
Diffstat (limited to 'admin/post')
-rw-r--r--admin/post/search.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/admin/post/search.php b/admin/post/search.php
index 46ff60d..5ec7ddc 100644
--- a/admin/post/search.php
+++ b/admin/post/search.php
@@ -37,7 +37,12 @@ if($search = HTTP::GET('q')) {
'category' => HTTP::GET('category')
];
- foreach ($PostRepository->search($search, $filter, $site_size, $offset) as $Post) {
+ if(!$posts = $PostRepository->search($search, $filter, $site_size, $offset)) {
+ $messages[] = Application::getLanguage()->text(
+ 'search_no_results', htmlspecialchars($search));
+ }
+
+ foreach($posts as $Post) {
$User = $UserRepository->find($Post->get('user'));
$templates[] = generatePostItemTemplate($Post, $User);
}