From ea391f91eaa3af672d1fd530834e2084e39a0736 Mon Sep 17 00:00:00 2001 From: nbm Date: Wed, 30 Nov 2005 21:12:06 +0000 Subject: [PATCH] Add validation of the search string not being empty. --- presentation/lookAndFeel/knowledgeTree/search/simpleSearch.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/presentation/lookAndFeel/knowledgeTree/search/simpleSearch.php b/presentation/lookAndFeel/knowledgeTree/search/simpleSearch.php index 1e08d94..5debce1 100644 --- a/presentation/lookAndFeel/knowledgeTree/search/simpleSearch.php +++ b/presentation/lookAndFeel/knowledgeTree/search/simpleSearch.php @@ -56,6 +56,12 @@ class SimpleSearchDispatcher extends KTStandardDispatcher { function do_main() { + $aErrorOptions = array( + "message" => "Please provide a search term", + ); + $searchable_text = KTUtil::arrayGet($_REQUEST, "fSearchableText"); + $this->oValidator->notEmpty($searchable_text, $aErrorOptions); + $collection = new DocumentCollection; $this->browseType = "Folder"; @@ -68,8 +74,6 @@ class SimpleSearchDispatcher extends KTStandardDispatcher { $collection->addColumn(new DateColumn("Last Modified","modified", "getLastModifiedDate")); $collection->addColumn(new UserColumn('Creator','creator_id','getCreatorID')); - $searchable_text = KTUtil::arrayGet($_REQUEST, "fSearchableText"); - $batchPage = (int) KTUtil::arrayGet($_REQUEST, "page", 0); $batchSize = 20; -- libgit2 0.21.4