X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/0df5ae0658b5ff409c2cc3d3da278692f80c790d..refs/pull/3616/head:/app/Http/Controllers/UserController.php diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index 9a2f2c867..3110f1a98 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -293,7 +293,7 @@ class UserController extends Controller { $validated = $this->validate($request, [ 'language' => ['required', 'string', 'max:20'], - 'active' => ['required', 'bool'], + 'active' => ['required', 'bool'], ]); $currentFavoritesStr = setting()->getForCurrentUser('code-language-favourites', ''); @@ -302,7 +302,7 @@ class UserController extends Controller $isFav = in_array($validated['language'], $currentFavorites); if (!$isFav && $validated['active']) { $currentFavorites[] = $validated['language']; - } else if ($isFav && !$validated['active']) { + } elseif ($isFav && !$validated['active']) { $index = array_search($validated['language'], $currentFavorites); array_splice($currentFavorites, $index, 1); }