X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/1f9704779919a2e094c17e8f556ec9cc92ac437b..refs/pull/2890/head:/app/Http/Controllers/SettingController.php diff --git a/app/Http/Controllers/SettingController.php b/app/Http/Controllers/SettingController.php index 50d91d388..d9f172081 100644 --- a/app/Http/Controllers/SettingController.php +++ b/app/Http/Controllers/SettingController.php @@ -1,5 +1,8 @@ -imageRepo = $imageRepo; - parent::__construct(); } /** @@ -29,8 +31,8 @@ class SettingController extends Controller $version = trim(file_get_contents(base_path('version'))); return view('settings.index', [ - 'version' => $version, - 'guestUser' => User::getDefault() + 'version' => $version, + 'guestUser' => User::getDefault(), ]); } @@ -47,10 +49,10 @@ class SettingController extends Controller // Cycles through posted settings and update them foreach ($request->all() as $name => $value) { + $key = str_replace('setting-', '', trim($name)); if (strpos($name, 'setting-') !== 0) { continue; } - $key = str_replace('setting-', '', trim($name)); setting()->put($key, $value); } @@ -68,8 +70,11 @@ class SettingController extends Controller setting()->remove('app-logo'); } + $section = $request->get('section', ''); + $this->logActivity(ActivityType::SETTINGS_UPDATE, $section); $this->showSuccessNotification(trans('settings.settings_save_success')); - $redirectLocation = '/settings#' . $request->get('section', ''); + $redirectLocation = '/settings#' . $section; + return redirect(rtrim($redirectLocation, '#')); } }