From 8b94cfdff727a8c3b905081b9fdb77a36b06afe6 Mon Sep 17 00:00:00 2001 From: sbenve <44841610+sbenve@users.noreply.github.com> Date: Tue, 7 Feb 2023 00:22:34 -0300 Subject: [PATCH] changes from @mieszkou https://github.com/danpros/htmly/pull/558 --- system/includes/functions.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/system/includes/functions.php b/system/includes/functions.php index 806273b..bd43560 100644 --- a/system/includes/functions.php +++ b/system/includes/functions.php @@ -200,7 +200,7 @@ function rebuilt_cache($type) if (is_array($tmp)) { foreach ($tmp as $file) { if(strpos($file, '/draft/') === false) { - $posts_cache_sorted[] = pathinfo($file); + $posts_cache_sorted[] = array_merge(pathinfo($file), ['content' => preg_replace('/\s+/', '', (file_get_contents($file)))]); } } } @@ -967,7 +967,7 @@ function get_keyword($keyword, $page, $perpage) foreach ($posts as $index => $v) { $arr = explode('_', $v['basename']); - $filter = $arr[1] . ' ' . $arr[2]; + $filter = $arr[1] . ' ' . $arr[2] . ' ' . $v['content']; foreach ($words as $word) { if (stripos($filter, $word) !== false) { if (!in_array($v, $tmp)) { @@ -1158,7 +1158,7 @@ function keyword_count($keyword) foreach ($posts as $index => $v) { $arr = explode('_', $v['basename']); - $filter = $arr[1] . ' ' . $arr[2]; + $filter = $arr[1] . ' ' . $arr[2] . ' ' . $v['content']; foreach ($words as $word) { if (stripos($filter, $word) !== false) { $tmp[] = $v;