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:
parent
4fa73be80e
commit
0bb5654f80
5 changed files with 52 additions and 55 deletions
app/Http/Controllers
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue