diff --git a/htdocs/core/lib/website.lib.php b/htdocs/core/lib/website.lib.php index 257a51e711e..a8f853f15f6 100644 --- a/htdocs/core/lib/website.lib.php +++ b/htdocs/core/lib/website.lib.php @@ -1100,7 +1100,7 @@ function getImagePublicURLOfObject($object, $no = 1, $extName = '') * WARNING: This function can be used by websites. * * @param string $type Type of container to search into (Example: '', 'page', 'blogpost', 'page,blogpost', ...) - * @param string $algo Algorithm used for search (Example: 'meta' is searching into meta information like title and description, 'content', 'sitefiles', or any combination 'meta,content,...') + * @param string $algo Algorithm used for search (Example: 'meta' is searching into meta information like title and description, 'content', 'sitefiles', or any combination 'meta,content,sitefiles') * @param string $searchstring Search string * @param int $max Max number of answers * @param string $sortfield Sort Fields @@ -1117,10 +1117,15 @@ function getPagesFromSearchCriterias($type, $algo, $searchstring, $max = 25, $so $error = 0; $arrayresult = array('code' => '', 'list' => array()); + // Clean parameters if (!is_object($weblangs)) { $weblangs = $langs; } + if (empty($algo)) { + $algo = 'content'; + } + /* if (empty($searchstring) && empty($type) && empty($langcode) && empty($otherfilters)) { $error++; $arrayresult['code'] = 'KO'; @@ -1131,6 +1136,7 @@ function getPagesFromSearchCriterias($type, $algo, $searchstring, $max = 25, $so $arrayresult['code'] = 'KO'; $arrayresult['message'] = $weblangs->trans("ErrorSearchCriteriaTooSmall"); } else { + */ $tmparrayoftype = explode(',', $type); /*foreach ($tmparrayoftype as $tmptype) { if (!in_array($tmptype, array('', 'page', 'blogpost'))) { @@ -1140,7 +1146,7 @@ function getPagesFromSearchCriterias($type, $algo, $searchstring, $max = 25, $so break; } }*/ - } + //} $searchdone = 0; $found = 0; diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 27e42007e95..3a2f4340df9 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -4345,7 +4345,7 @@ if ($action == 'editmeta' || $action == 'createcontainer') { // Edit properties print $langs->trans('WEBSITE_TYPE_CONTAINER'); print ''; print img_picto('', 'object_technic', 'class="paddingrightonly"').' '; - print $formwebsite->selectTypeOfContainer('WEBSITE_TYPE_CONTAINER', (GETPOST('WEBSITE_TYPE_CONTAINER', 'alpha') ? GETPOST('WEBSITE_TYPE_CONTAINER', 'alpha') : $type_container), 0, '', 1); + print $formwebsite->selectTypeOfContainer('WEBSITE_TYPE_CONTAINER', (GETPOST('WEBSITE_TYPE_CONTAINER', 'alpha') ? GETPOST('WEBSITE_TYPE_CONTAINER', 'alpha') : $type_container), 0, '', 1, 'minwidth300'); print ''; print '