diff --git a/mod/search.php b/mod/search.php index 9651d5c9b4..7cd5233bfc 100644 --- a/mod/search.php +++ b/mod/search.php @@ -19,7 +19,7 @@ use Friendica\Module\BaseSearchModule; use Friendica\Util\Strings; function search_init(App $a) { - $search = (!empty($_GET['search']) ? Strings::escapeTags(trim(rawurldecode($_GET['search']))) : ''); + $search = (!empty($_GET['q']) ? Strings::escapeTags(trim(rawurldecode($_GET['q']))) : ''); if (local_user()) { /// @todo Check if there is a case at all that "aside" is prefilled here @@ -69,7 +69,7 @@ function search_content(App $a) { Nav::setSelected('search'); - $search = (!empty($_REQUEST['search']) ? Strings::escapeTags(trim(rawurldecode($_REQUEST['search']))) : ''); + $search = (!empty($_REQUEST['q']) ? Strings::escapeTags(trim(rawurldecode($_REQUEST['q']))) : ''); $tag = false; if (!empty($_GET['tag'])) { @@ -82,7 +82,7 @@ function search_content(App $a) { 'name' => "search-header", '$title' => L10n::t("Search"), '$title_size' => 3, - '$content' => HTML::search($search,'search-box','search', false) + '$content' => HTML::search($search,'search-box',false) ]); if (strpos($search,'#') === 0) { diff --git a/src/Content/Text/HTML.php b/src/Content/Text/HTML.php index eee443a8f3..ea9a4737cd 100644 --- a/src/Content/Text/HTML.php +++ b/src/Content/Text/HTML.php @@ -893,9 +893,9 @@ class HTML * @param bool $aside Display the search widgit aside. * * @return string Formatted HTML. - * @throws \Friendica\Network\HTTPException\InternalServerErrorException + * @throws \Exception */ - public static function search($s, $id = 'search-box', $url = 'search', $aside = true) + public static function search($s, $id = 'search-box', $aside = true) { $mode = 'text'; @@ -905,24 +905,25 @@ class HTML $save_label = $mode === 'text' ? L10n::t('Save') : L10n::t('Follow'); $values = [ - '$s' => $s, - '$id' => $id, - '$action_url' => $url, - '$search_label' => L10n::t('Search'), - '$save_label' => $save_label, - '$savedsearch' => 'savedsearch', - '$search_hint' => L10n::t('@name, !forum, #tags, content'), - '$mode' => $mode - ]; + '$s' => $s, + '$q' => urlencode($s), + '$id' => $id, + '$search_label' => L10n::t('Search'), + '$save_label' => $save_label, + '$search_hint' => L10n::t('@name, !forum, #tags, content'), + '$mode' => $mode, + '$return_url' => urlencode('search?q=' . $s), + ]; if (!$aside) { - $values['$searchoption'] = [ - L10n::t("Full Text"), - L10n::t("Tags"), - L10n::t("Contacts")]; + $values['$search_options'] = [ + 'fulltext' => L10n::t('Full Text'), + 'tags' => L10n::t('Tags'), + 'contacts' => L10n::t('Contacts') + ]; if (Config::get('system', 'poco_local_search')) { - $values['$searchoption'][] = L10n::t("Forums"); + $values['$searchoption']['forums'] = L10n::t('Forums'); } } diff --git a/view/templates/searchbox.tpl b/view/templates/searchbox.tpl index 4b1a51f877..d566befba0 100644 --- a/view/templates/searchbox.tpl +++ b/view/templates/searchbox.tpl @@ -1,20 +1,18 @@