diff --git a/app/Http/Controllers/StartpageController.php b/app/Http/Controllers/StartpageController.php index aeab97a45fea6967f12fae8f5f09406d84305b67..756e1b1b5f8b777dc6b052eacfc7940b79541893 100644 --- a/app/Http/Controllers/StartpageController.php +++ b/app/Http/Controllers/StartpageController.php @@ -3,12 +3,12 @@ namespace App\Http\Controllers; use App; +use DB; use Illuminate\Http\Request; use Jenssegers\Agent\Agent; use LaravelLocalization; -use Response; -use DB; use Log; +use Response; class StartpageController extends Controller { @@ -22,9 +22,9 @@ class StartpageController extends Controller public function loadStartPage(Request $request) { $focusPages = []; - $theme = "default"; + $theme = "default"; - $optionParams = ['param_sprueche', 'param_newtab', 'param_maps', 'param_autocomplete', 'param_lang', 'param_key']; + $optionParams = ['param_sprueche', 'param_newtab', 'param_maps', 'param_autocomplete', 'param_lang', 'param_key']; $option_values = []; foreach ($optionParams as $param) { @@ -43,12 +43,12 @@ class StartpageController extends Controller if ($lang === 'de' || $lang === "en") { $lang = 'all'; } - + # Sponsorenlinks $sponsors = []; - try{ + try { $sponsors = DB::table('sponsorenlinks')->where('langcode', 'de')->orderByRaw('LENGTH(linktext)', 'ASC')->get(); - } catch(\Illuminate\Database\QueryException $e){ + } catch (\Illuminate\Database\QueryException $e) { Log::info($e); } @@ -89,9 +89,9 @@ class StartpageController extends Controller public function loadPlugin($params, $locale = "de") { - $params = unserialize(base64_decode($params)); + $params = unserialize(base64_decode($params)); $requests = $params; - $params = []; + $params = []; foreach ($requests as $key => $value) { if (strpos($key, "param_") === 0) { $key = substr($key, strpos($key, "param_") + 6); @@ -146,12 +146,12 @@ class StartpageController extends Controller public function berlin(Request $request) { - $link = ""; + $link = ""; $password = ""; if ($request->filled('eingabe')) { $password = getenv('berlin'); $password = md5($request->input('eingabe') . " -host:userpage.fu-berlin.de" . $password); - $link = "/meta/meta.ger3?eingabe=" . $request->input('eingabe') . " -host:userpage.fu-berlin.de&focus=web&password=" . $password . "&encoding=utf8&lang=all&site=fu-berlin.de&quicktips=off&out=results-with-style"; + $link = "/meta/meta.ger3?eingabe=" . $request->input('eingabe') . " -host:userpage.fu-berlin.de&focus=web&password=" . $password . "&encoding=utf8&lang=all&site=fu-berlin.de&quicktips=off&out=results-with-style"; } return view('berlin') ->with('title', 'Testseite für die FU-Berlin') diff --git a/app/MetaGer.php b/app/MetaGer.php index e83f014f1c5106adc68628273c52cd1db10b4837..e8082439dcca7f640cf766079e8a49f13164c672 100644 --- a/app/MetaGer.php +++ b/app/MetaGer.php @@ -98,8 +98,8 @@ class MetaGer $focusPages = []; foreach ($this->request->all() as $key => $value) { - if ($value === 'on') { - $focusPages[] = str_replace('param_', '', str_replace('engine_', '', $key)); + if (starts_with($key, 'engine_') && $value === 'on') { + $focusPages[] = $key; } } diff --git a/resources/views/parts/searchbar.blade.php b/resources/views/parts/searchbar.blade.php index abd7f7772ad03b28aeea402ecdce4278ade240e6..81f14dff1a538dab0ef79ce4a193ecb6261bb6f5 100644 --- a/resources/views/parts/searchbar.blade.php +++ b/resources/views/parts/searchbar.blade.php @@ -45,7 +45,6 @@ <input type="hidden" name="time" value={{ $time }}> @endif @if (isset($focusPages) && !empty($focusPages)) - <input type="hidden" name="focus" value="focus_custom"> @foreach ($focusPages as $fp) <input type="hidden" name={{ $fp }} value="on"> @endforeach