Commit ea391f91eaa3af672d1fd530834e2084e39a0736

Authored by nbm
1 parent 6cdbc0a9

Add validation of the search string not being empty.


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@4278 c91229c3-7414-0410-bfa2-8a42b809f60b
presentation/lookAndFeel/knowledgeTree/search/simpleSearch.php
... ... @@ -56,6 +56,12 @@ class SimpleSearchDispatcher extends KTStandardDispatcher {
56 56  
57 57  
58 58 function do_main() {
  59 + $aErrorOptions = array(
  60 + "message" => "Please provide a search term",
  61 + );
  62 + $searchable_text = KTUtil::arrayGet($_REQUEST, "fSearchableText");
  63 + $this->oValidator->notEmpty($searchable_text, $aErrorOptions);
  64 +
59 65 $collection = new DocumentCollection;
60 66 $this->browseType = "Folder";
61 67  
... ... @@ -68,8 +74,6 @@ class SimpleSearchDispatcher extends KTStandardDispatcher {
68 74 $collection->addColumn(new DateColumn("Last Modified","modified", "getLastModifiedDate"));
69 75 $collection->addColumn(new UserColumn('Creator','creator_id','getCreatorID'));
70 76  
71   - $searchable_text = KTUtil::arrayGet($_REQUEST, "fSearchableText");
72   -
73 77 $batchPage = (int) KTUtil::arrayGet($_REQUEST, "page", 0);
74 78 $batchSize = 20;
75 79  
... ...