1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-06-13 00:41:59 +03:00

Updated composer deps, applied StyleCI changes

This commit is contained in:
Dan Brown
2022-07-27 11:07:41 +01:00
parent 4fa73be80e
commit 0bb5654f80
5 changed files with 52 additions and 55 deletions

View File

@ -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);
}