فهرست منبع

#4120 - Minor fixes - searchKeywordContent with empty 'keyword' value

roman.lesnikov@gmail.com 4 سال پیش
والد
کامیت
e0d3f88e01
1فایلهای تغییر یافته به همراه20 افزوده شده و 19 حذف شده
  1. 20 19
      searchKeywordContent.php

+ 20 - 19
searchKeywordContent.php

@@ -10,29 +10,30 @@
 require_once('./inc/header.inc.php');
 require_once(BX_DIRECTORY_PATH_INC . "design.inc.php");
 
-bx_import('BxDolLanguages');
+if (bx_get('keyword')){
+    bx_import('BxDolLanguages');
 
-$sClass = 'BxDolSearch';
+    $sClass = 'BxDolSearch';
 
-$sElsName = 'bx_elasticsearch';
-$sElsMethod = 'is_configured';
-if(BxDolRequest::serviceExists($sElsName, $sElsMethod) && BxDolService::call($sElsName, $sElsMethod)) {
-     $oModule = BxDolModule::getInstance($sElsName);
+    $sElsName = 'bx_elasticsearch';
+    $sElsMethod = 'is_configured';
+    if(BxDolRequest::serviceExists($sElsName, $sElsMethod) && BxDolService::call($sElsName, $sElsMethod)) {
+         $oModule = BxDolModule::getInstance($sElsName);
 
-     bx_import('Search', $oModule->_aModule);
-     $sClass = 'BxElsSearch';
-}
-
-$o = new $sClass(bx_get('section'));
-$o->setLiveSearch(bx_get('live_search') ? 1 : 0);
-$o->setMetaType(bx_process_input(bx_get('type')));
-$o->setCategoryObject(bx_process_input(bx_get('cat')));
+         bx_import('Search', $oModule->_aModule);
+         $sClass = 'BxElsSearch';
+    }
 
-$s = $o->response();
-if (!$s)
-    $s = $o->getEmptyResult();
+    $o = new $sClass(bx_get('section'));
+    $o->setLiveSearch(bx_get('live_search') ? 1 : 0);
+    $o->setMetaType(bx_process_input(bx_get('type')));
+    $o->setCategoryObject(bx_process_input(bx_get('cat')));
 
-header('Content-type: text/html; charset=utf-8');
-echo $s;
+    $s = $o->response();
+    if (!$s)
+        $s = $o->getEmptyResult();
 
+    header('Content-type: text/html; charset=utf-8');
+    echo $s;
+}
 /** @} */