X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/4e8722661faaf1f44d6884a48cbd301b40d194d8..refs/pull/768/head:/app/Http/Controllers/SettingController.php diff --git a/app/Http/Controllers/SettingController.php b/app/Http/Controllers/SettingController.php index 61ce55fa9..e0e351458 100644 --- a/app/Http/Controllers/SettingController.php +++ b/app/Http/Controllers/SettingController.php @@ -1,8 +1,7 @@ setPageTitle('Settings'); // Get application version - $version = false; - if (function_exists('exec')) { - $version = exec('git describe --always --tags '); - } + $version = trim(file_get_contents(base_path('version'))); return view('settings/index', ['version' => $version]); } @@ -37,13 +33,14 @@ class SettingController extends Controller // Cycles through posted settings and update them foreach ($request->all() as $name => $value) { - if (strpos($name, 'setting-') !== 0) continue; + if (strpos($name, 'setting-') !== 0) { + continue; + } $key = str_replace('setting-', '', trim($name)); Setting::put($key, $value); } - session()->flash('success', 'Settings Saved'); + session()->flash('success', trans('settings.settings_save_success')); return redirect('/settings'); } - }