Apps/Controller/Front/Search.php 1 location
|
@@ 35-37 (lines=3) @@
|
| 32 |
|
$configs = $this->getConfigs(); |
| 33 |
|
|
| 34 |
|
// check search query length |
| 35 |
|
if (Str::likeEmpty($query) || Str::length($query) < (int)$configs['minLength']) { |
| 36 |
|
throw new NotFoundException(__('Search query is too short!')); |
| 37 |
|
} |
| 38 |
|
|
| 39 |
|
// prevent sh@t query's with big length |
| 40 |
|
if (Str::length($query) > static::QUERY_MAX_LENGTH) { |
Apps/Controller/Front/Content.php 1 location
|
@@ 178-180 (lines=3) @@
|
| 175 |
|
$tagName = trim($tagName); |
| 176 |
|
|
| 177 |
|
// check if tag is not empty |
| 178 |
|
if (Str::likeEmpty($tagName) || Str::length($tagName) < 2) { |
| 179 |
|
throw new NotFoundException(__('Tag is empty or is too short!')); |
| 180 |
|
} |
| 181 |
|
|
| 182 |
|
// get equal rows order by creation date |
| 183 |
|
$records = ContentEntity::where('meta_keywords', 'like', '%' . $tagName . '%')->orderBy('created_at', 'DESC')->take(self::TAG_PER_PAGE); |