aboutsummaryrefslogtreecommitdiff
path: root/app/class
diff options
context:
space:
mode:
Diffstat (limited to 'app/class')
-rw-r--r--app/class/Controllerhome.php3
-rw-r--r--app/class/Modelhome.php7
2 files changed, 8 insertions, 2 deletions
diff --git a/app/class/Controllerhome.php b/app/class/Controllerhome.php
index 2fa06fb..5a9110a 100644
--- a/app/class/Controllerhome.php
+++ b/app/class/Controllerhome.php
@@ -32,12 +32,13 @@ class Controllerhome extends Controllerpage
$vars['colors'] = new Colors($this->opt->taglist());
if (!isset($_GET['search'])) {
- $searchopt = ['title' => 1, 'description' => 1, 'content' => 1, 'other' => 0];
+ $searchopt = ['title' => 1, 'description' => 1, 'content' => 1, 'other' => 0, 'casesensitive' => 0];
} else {
$searchopt['title'] = $_GET['title'] ?? 0;
$searchopt['description'] = $_GET['description'] ?? 0;
$searchopt['content'] = $_GET['content'] ?? 0;
$searchopt['other'] = $_GET['other'] ?? 0;
+ $searchopt['casesensitive'] = $_GET['case'] ?? 0;
}
$regex = $_GET['search'] ?? '';
diff --git a/app/class/Modelhome.php b/app/class/Modelhome.php
index 541eb07..e3d60a3 100644
--- a/app/class/Modelhome.php
+++ b/app/class/Modelhome.php
@@ -96,7 +96,12 @@ class Modelhome extends Modelpage
*/
public function deepsearch(string $regex, array $options, array $pagelist) : array
{
- $regex = '/' . $regex . '/';
+ if($options['casesensitive']) {
+ $case = '';
+ } else {
+ $case = 'i';
+ }
+ $regex = '/' . $regex . '/' . $case;
$pageselected = [];
foreach ($pagelist as $page) {
$count = 0;