From 4677116c8e5f28793077917af32dc3462e5054ac Mon Sep 17 00:00:00 2001 From: Semenov Date: Fri, 8 Dec 2023 10:01:07 +0300 Subject: [PATCH] dev --- src/CmsSearchComponent.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/CmsSearchComponent.php b/src/CmsSearchComponent.php index d6dd6c7..b5b4c31 100644 --- a/src/CmsSearchComponent.php +++ b/src/CmsSearchComponent.php @@ -19,6 +19,7 @@ use skeeks\cms\search\assets\CmsSearchAsset; use yii\data\ActiveDataProvider; use yii\helpers\ArrayHelper; +use yii\web\NotFoundHttpException; use yii\widgets\ActiveForm; /** @@ -154,6 +155,10 @@ public function getSearchQuery() public function buildElementsQuery(\yii\db\ActiveQuery $activeQuery) { $where = []; + + if (!\Yii::$app->request->referrer) { + throw new NotFoundHttpException("Поисковый запрос некорректный"); + } $searchQueryArr = explode(" ", $this->searchQuery); if ($searchQueryArr) {