0
0
Fork 0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-05-19 06:31:30 +00: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
No known key found for this signature in database
GPG key ID: 46D9F943C24A2EF9
5 changed files with 52 additions and 55 deletions
app/Http/Controllers

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