Commit a1a98edf authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

searches with an empty query now get redirected to our startpage

parent bdbf4b8b
...@@ -7,6 +7,7 @@ use App\MetaGer; ...@@ -7,6 +7,7 @@ use App\MetaGer;
use Cache; use Cache;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\Redis; use Illuminate\Support\Facades\Redis;
use LaravelLocalization;
use View; use View;
const TIP_SERVER = 'http://metager3.de:63825/tips.xml'; const TIP_SERVER = 'http://metager3.de:63825/tips.xml';
...@@ -22,6 +23,12 @@ class MetaGerSearch extends Controller ...@@ -22,6 +23,12 @@ class MetaGerSearch extends Controller
return redirect()->to('https://maps.metager.de/map/' . $searchinput . '/1240908.5493525574,6638783.2192695495,6'); return redirect()->to('https://maps.metager.de/map/' . $searchinput . '/1240908.5493525574,6638783.2192695495,6');
} }
# If there is no query parameter we redirect to the startpage
$eingabe = $request->input('eingabe', '');
if (empty(trim($eingabe))) {
return redirect(LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), '/'));
}
# Mit gelieferte Formulardaten parsen und abspeichern: # Mit gelieferte Formulardaten parsen und abspeichern:
$metager->parseFormData($request); $metager->parseFormData($request);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment