diff --git a/build/fpm/Dockerfile b/build/fpm/Dockerfile index 110a0efb1d2b1ab39d812b318e1c5fd9d4defb51..27e0c8bf02de950c658c26c8165bcda6bf0a4bb0 100644 --- a/build/fpm/Dockerfile +++ b/build/fpm/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.0.19-fpm as composer +FROM php:8.1.6-fpm as composer # Add Composer installation to image ADD build/fpm/installcomposer.sh /usr/bin/installcomposer diff --git a/metager/app/Http/Controllers/MetaGerSearch.php b/metager/app/Http/Controllers/MetaGerSearch.php index 1eb026b9821c79c992e0feabf4defea15746b02f..0d2b744e3ac66279f93f6ba48fda93c2f0d1726d 100644 --- a/metager/app/Http/Controllers/MetaGerSearch.php +++ b/metager/app/Http/Controllers/MetaGerSearch.php @@ -4,12 +4,13 @@ namespace App\Http\Controllers; use App\MetaGer; use App\PrometheusExporter; -use Cache; +use Illuminate\Support\Facades\Cache; use Illuminate\Http\Request; use Mcamara\LaravelLocalization\Facades\LaravelLocalization; -use Log; +use Illuminate\Support\Facades\Log; use Prometheus\CollectorRegistry; -use View; +use Illuminate\Support\Facades\View; +use Illuminate\Support\Facades\App; class MetaGerSearch extends Controller { @@ -346,7 +347,7 @@ class MetaGerSearch extends Controller public function tips(Request $request) { $tipserver = ''; - if (\App::environment() === "development") { + if (App::environment() === "development") { $tipserver = "https://dev.quicktips.metager.de/1.1/tips.xml"; } else { $tipserver = "https://quicktips.metager.de/1.1/tips.xml"; @@ -373,18 +374,4 @@ class MetaGerSearch extends Controller ->with('title', trans('tips.title')) ->with('tips', $tips); } - - public function quicktips(Request $request) - { - $search = $request->input('search', ''); - $quotes = $request->input('quotes', 'on'); - if (empty($search)) { - abort(404); - } - - $quicktips = new \App\Models\Quicktips\Quicktips($search, $quotes); - return view('quicktips') - ->with('quicktips', $quicktips->getResults()) - ->with('search', $search); - } } diff --git a/metager/app/MetaGer.php b/metager/app/MetaGer.php index de23846bf871d41f29a1e9794060ffd74d0fcc35..c1695a0d99877ca66dfaadfe16936f9eab7bbf18 100644 --- a/metager/app/MetaGer.php +++ b/metager/app/MetaGer.php @@ -3,15 +3,14 @@ namespace App; use Illuminate\Support\Facades\App; -use Cache; -use Carbon; -use Cookie; -use Illuminate\Http\Request; +use Illuminate\Support\Facades\Cache; +use Carbon\Carbon; +use Illuminate\Support\Facades\Cookie; +use Illuminate\Support\Facades\Request; use Illuminate\Support\Facades\Redis; use Jenssegers\Agent\Agent; -use LaravelLocalization; -use Log; -use Monospice\LaravelRedisSentinel\RedisSentinel; +use Mcamara\LaravelLocalization\Facades\LaravelLocalization; +use Illuminate\Support\Facades\Log; use Predis\Connection\ConnectionException; class MetaGer @@ -428,8 +427,7 @@ class MetaGer } /** - * @param \App\Models\Admitad[] $admitads - * @param Boolean $wait Wait for Results? + * @param \App\Models\Admitad[] $affiliates * @return Boolean whether or not all Admitad Objects are finished */ public function parseAffiliates(&$affiliates) @@ -556,7 +554,7 @@ class MetaGer $autoDisabled = empty($suma->{"auto-disabled"}) ? false : $suma->{"auto-disabled"}; if ( $disabled || $autoDisabled - || \Cookie::get($this->getFokus() . "_engine_" . $sumaName) === "off" + || Cookie::get($this->getFokus() . "_engine_" . $sumaName) === "off" ) { continue; } @@ -614,7 +612,7 @@ class MetaGer # Special case if search engines are disabled # Since bing is normally only active if a filter is set but it should be active, too if yahoo is disabled - if ($this->getFokus() === "web" && empty($this->enabledSearchengines["yahoo"]) && \Cookie::get("web_engine_bing") !== "off" && isset($this->sumaFile->sumas->{"bing"})) { + if ($this->getFokus() === "web" && empty($this->enabledSearchengines["yahoo"]) && Cookie::get("web_engine_bing") !== "off" && isset($this->sumaFile->sumas->{"bing"})) { $this->enabledSearchengines["bing"] = $this->sumaFile->sumas->{"bing"}; } @@ -783,7 +781,7 @@ class MetaGer } # We will also add the filter from the opt-in search engines (the searchengines that are only used when a filter of it is too) foreach ($this->sumaFile->foki->{$this->fokus}->sumas as $suma) { - if ($this->sumaFile->sumas->{$suma}->{"filter-opt-in"} && \Cookie::get($this->getFokus() . "_engine_" . $suma) !== "off") { + if ($this->sumaFile->sumas->{$suma}->{"filter-opt-in"} && Cookie::get($this->getFokus() . "_engine_" . $suma) !== "off") { if (!empty($filter->sumas->{$suma})) { # If the searchengine is disabled this filter shouldn't be available if ((!empty($this->sumaFile->sumas->{$suma}->disabled) && $this->sumaFile->sumas->{$suma}->disabled === true) @@ -812,10 +810,10 @@ class MetaGer # Set the current values for the filters foreach ($availableFilter as $filterName => $filter) { - if (\Request::filled($filter->{"get-parameter"})) { - $filter->value = \Request::input($filter->{"get-parameter"}); - } elseif (\Cookie::get($this->getFokus() . "_setting_" . $filter->{"get-parameter"}) !== null) { - $filter->value = \Cookie::get($this->getFokus() . "_setting_" . $filter->{"get-parameter"}); + if (Request::filled($filter->{"get-parameter"})) { + $filter->value = Request::input($filter->{"get-parameter"}); + } elseif (Cookie::get($this->getFokus() . "_setting_" . $filter->{"get-parameter"}) !== null) { + $filter->value = Cookie::get($this->getFokus() . "_setting_" . $filter->{"get-parameter"}); } } @@ -1031,7 +1029,7 @@ class MetaGer $this->agent = new Agent(); $this->mobile = $this->agent->isMobile(); # Sprüche - if (!App::isLocale('de') || (\Cookie::has('zitate') && \Cookie::get('zitate') === 'off')) { + if (!App::isLocale('de') || (Cookie::has('zitate') && Cookie::get('zitate') === 'off')) { $this->sprueche = 'off'; } else { $this->sprueche = 'on'; @@ -1040,7 +1038,7 @@ class MetaGer $this->sprueche = $request->input('quotes'); } - $this->newtab = $request->input('new_tab', \Cookie::get('new_tab')); + $this->newtab = $request->input('new_tab', Cookie::get('new_tab')); if ($this->newtab === "on") { $this->newtab = "_blank"; } elseif ($this->framed) { @@ -1089,7 +1087,7 @@ class MetaGer $this->apiKey = $request->input('key', ''); if (empty($this->apiKey)) { - $this->apiKey = \Cookie::get('key'); + $this->apiKey = Cookie::get('key'); if (empty($this->apiKey)) { $this->apiKey = ""; } @@ -1276,12 +1274,12 @@ class MetaGer } if (($request->filled($filter->{"get-parameter"}) && $request->input($filter->{"get-parameter"}) !== "off") || - \Cookie::get($this->getFokus() . "_setting_" . $filter->{"get-parameter"}) !== null + Cookie::get($this->getFokus() . "_setting_" . $filter->{"get-parameter"}) !== null ) { # If the filter is set via Cookie $this->parameterFilter[$filterName] = $filter; $this->parameterFilter[$filterName]->value = $request->input($filter->{"get-parameter"}, ''); if (empty($this->parameterFilter[$filterName]->value)) { - $this->parameterFilter[$filterName]->value = \Cookie::get($this->getFokus() . "_setting_" . $filter->{"get-parameter"}); + $this->parameterFilter[$filterName]->value = Cookie::get($this->getFokus() . "_setting_" . $filter->{"get-parameter"}); } } } @@ -1699,8 +1697,8 @@ class MetaGer $filters = $this->sumaFile->filter->{"parameter-filter"}; foreach ($filters as $filterName => $filter) { if ( - \Request::filled($filter->{"get-parameter"}) - && \Cookie::get($this->getFokus() . "_setting_" . $filter->{"get-parameter"}) !== \Request::input($filter->{"get-parameter"}) + Request::filled($filter->{"get-parameter"}) + && Cookie::get($this->getFokus() . "_setting_" . $filter->{"get-parameter"}) !== Request::input($filter->{"get-parameter"}) ) { return true; } @@ -1710,12 +1708,11 @@ class MetaGer public function getSavedSettingCount() { - $cookies = \Cookie::get(); + $cookies = Cookie::get(); $count = 0; $sumaFile = MetaGer::getLanguageFile(); $sumaFile = json_decode(file_get_contents($sumaFile), true); - $foki = array_keys($sumaFile['foki']); foreach ($cookies as $key => $value) { if (in_array($key, [$this->getFokus() . "_setting_", $this->getFokus() . "_engine_", $this->getFokus() . "_blpage"])) { diff --git a/metager/routes/web.php b/metager/routes/web.php index b7b38cfa2a20f13037c8089d8a2782393d0ab4b7..ac777ec4f32d17e33e5c6c748e4ed861e85322d7 100644 --- a/metager/routes/web.php +++ b/metager/routes/web.php @@ -299,7 +299,6 @@ Route::get('clickstats', 'LogController@clicklog'); Route::get('pluginClose', 'LogController@pluginClose'); Route::get('pluginInstall', 'LogController@pluginInstall'); -Route::get('qt', 'MetaGerSearch@quicktips'); Route::get('tips', 'MetaGerSearch@tips'); Route::get('/plugins/opensearch.xml', 'StartpageController@loadPlugin'); Route::get('owi', function () {