@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | // Validate cover type |
| 21 | 21 | $validTypes = ['anime', 'audio', 'audiosample', 'book', 'console', 'games', 'movies', 'music', 'preview', 'sample', 'tvrage', 'video', 'xxx', 'tvshows']; |
| 22 | 22 | |
| 23 | - if (! in_array($type, $validTypes)) { |
|
| 23 | + if (!in_array($type, $validTypes)) { |
|
| 24 | 24 | abort(404); |
| 25 | 25 | } |
| 26 | 26 | |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | // Check if file exists |
| 45 | - if (! file_exists($filePath)) { |
|
| 45 | + if (!file_exists($filePath)) { |
|
| 46 | 46 | // Return placeholder image |
| 47 | 47 | $placeholderPath = public_path('assets/images/no-cover.png'); |
| 48 | 48 | if (file_exists($placeholderPath)) { |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | // Get the default user role. |
| 165 | 165 | $userDefault = Role::query()->where('isdefault', '=', 1)->first(); |
| 166 | 166 | |
| 167 | - if (! empty($error)) { |
|
| 167 | + if (!empty($error)) { |
|
| 168 | 168 | return $this->showRegistrationForm($request, $error); |
| 169 | 169 | } |
| 170 | 170 | |
@@ -177,13 +177,13 @@ discard block |
||
| 177 | 177 | $invitedBy = 0; |
| 178 | 178 | $invitation = null; |
| 179 | 179 | |
| 180 | - if (! empty($inviteCode)) { |
|
| 180 | + if (!empty($inviteCode)) { |
|
| 181 | 181 | $invitation = Invitation::findValidByToken($inviteCode); |
| 182 | 182 | if ($invitation) { |
| 183 | 183 | $invitedBy = $invitation->invited_by; |
| 184 | 184 | |
| 185 | 185 | // Validate email matches invitation |
| 186 | - if (! empty($invitation->email) && $invitation->email !== $email) { |
|
| 186 | + if (!empty($invitation->email) && $invitation->email !== $email) { |
|
| 187 | 187 | $error = 'Email address does not match the invitation.'; |
| 188 | 188 | |
| 189 | 189 | return $this->showRegistrationForm($request, $error); |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | case 'view': |
| 238 | 238 | // Don't set showRegister here - let showRegistrationForm handle it |
| 239 | 239 | // Only validate invite code if present |
| 240 | - if (($inviteCode !== null) && ! $this->isInvitationTokenValid($inviteCode)) { |
|
| 240 | + if (($inviteCode !== null) && !$this->isInvitationTokenValid($inviteCode)) { |
|
| 241 | 241 | $error = 'Invalid invitation token!'; |
| 242 | 242 | } |
| 243 | 243 | break; |
@@ -263,14 +263,14 @@ discard block |
||
| 263 | 263 | $emailFromInvite = ''; |
| 264 | 264 | |
| 265 | 265 | if ((int) Settings::settingValue('registerstatus') === Settings::REGISTER_STATUS_INVITE) { |
| 266 | - if (! empty($inviteCode)) { |
|
| 266 | + if (!empty($inviteCode)) { |
|
| 267 | 267 | if ($this->isInvitationTokenValid($inviteCode)) { |
| 268 | 268 | $error = ''; |
| 269 | 269 | $showRegister = 1; |
| 270 | 270 | |
| 271 | 271 | // Pre-fill email if invitation has one |
| 272 | 272 | $invitation = Invitation::findValidByToken($inviteCode); |
| 273 | - if ($invitation && ! empty($invitation->email)) { |
|
| 273 | + if ($invitation && !empty($invitation->email)) { |
|
| 274 | 274 | $emailFromInvite = $invitation->email; |
| 275 | 275 | } |
| 276 | 276 | } else { |
@@ -311,12 +311,12 @@ discard block |
||
| 311 | 311 | |
| 312 | 312 | $invitation = Invitation::findValidByToken($token); |
| 313 | 313 | |
| 314 | - if (! $invitation) { |
|
| 314 | + if (!$invitation) { |
|
| 315 | 315 | return false; |
| 316 | 316 | } |
| 317 | 317 | |
| 318 | 318 | // If invitation has specific email, validate it matches |
| 319 | - if (! empty($invitation->email) && $invitation->email !== $email) { |
|
| 319 | + if (!empty($invitation->email) && $invitation->email !== $email) { |
|
| 320 | 320 | return false; |
| 321 | 321 | } |
| 322 | 322 | |
@@ -59,7 +59,7 @@ |
||
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | // Check users exists and send an email |
| 62 | - $ret = ! empty($rssToken) ? User::getByRssToken($rssToken) : User::getByEmail($email); |
|
| 62 | + $ret = !empty($rssToken) ? User::getByRssToken($rssToken) : User::getByEmail($email); |
|
| 63 | 63 | if ($ret === null) { |
| 64 | 64 | return view('auth.passwords.email')->withErrors(['error' => 'The email or apikey are not recognised.']); |
| 65 | 65 | } |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | |
| 76 | 76 | if ($validator->passes()) { |
| 77 | 77 | $user = User::query() |
| 78 | - ->where(function ($query) use ($request) { |
|
| 78 | + ->where(function($query) use ($request) { |
|
| 79 | 79 | $query->where('username', $request->input('username')) |
| 80 | 80 | ->orWhere('email', $request->input('username')); |
| 81 | 81 | }) |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | |
| 92 | 92 | $rememberMe = $request->has('rememberme') && $request->input('rememberme') === 'on'; |
| 93 | 93 | |
| 94 | - if (! $user->isVerified() || $user->isPendingVerification()) { |
|
| 94 | + if (!$user->isVerified() || $user->isPendingVerification()) { |
|
| 95 | 95 | $request->session()->flash('message', 'You have not verified your email address!'); |
| 96 | 96 | |
| 97 | 97 | return redirect()->to('login'); |
@@ -210,14 +210,14 @@ discard block |
||
| 210 | 210 | if ($remainingMinutes > 0) { |
| 211 | 211 | // Create a cookie with proper settings for persistence |
| 212 | 212 | $cookie = cookie( |
| 213 | - '2fa_trusted_device', // name |
|
| 214 | - $trustedDeviceCookie, // value |
|
| 215 | - $remainingMinutes, // minutes remaining |
|
| 216 | - '/', // path |
|
| 213 | + '2fa_trusted_device', // name |
|
| 214 | + $trustedDeviceCookie, // value |
|
| 215 | + $remainingMinutes, // minutes remaining |
|
| 216 | + '/', // path |
|
| 217 | 217 | config('session.domain'), // use session domain config |
| 218 | 218 | config('session.secure'), // use session secure config |
| 219 | - false, // httpOnly |
|
| 220 | - false, // raw |
|
| 219 | + false, // httpOnly |
|
| 220 | + false, // raw |
|
| 221 | 221 | config('session.same_site', 'lax') // use session same_site config |
| 222 | 222 | ); |
| 223 | 223 | |
@@ -116,7 +116,7 @@ |
||
| 116 | 116 | |
| 117 | 117 | // If there's an override and no mutator has been explicitly defined on |
| 118 | 118 | // the model then use the override value |
| 119 | - if ($override && ! $this->hasGetMutator($key)) { |
|
| 119 | + if ($override && !$this->hasGetMutator($key)) { |
|
| 120 | 120 | return $override->value; |
| 121 | 121 | } |
| 122 | 122 | |
@@ -15,12 +15,12 @@ discard block |
||
| 15 | 15 | |
| 16 | 16 | // Enforce that both providers cannot be enabled at the same time |
| 17 | 17 | $recaptchaEnabled = config('captcha.recaptcha.enabled') === true |
| 18 | - && ! empty(config('captcha.recaptcha.sitekey')) |
|
| 19 | - && ! empty(config('captcha.recaptcha.secret')); |
|
| 18 | + && !empty(config('captcha.recaptcha.sitekey')) |
|
| 19 | + && !empty(config('captcha.recaptcha.secret')); |
|
| 20 | 20 | |
| 21 | 21 | $turnstileEnabled = config('captcha.turnstile.enabled') === true |
| 22 | - && ! empty(config('captcha.turnstile.sitekey')) |
|
| 23 | - && ! empty(config('captcha.turnstile.secret')); |
|
| 22 | + && !empty(config('captcha.turnstile.sitekey')) |
|
| 23 | + && !empty(config('captcha.turnstile.secret')); |
|
| 24 | 24 | |
| 25 | 25 | // If both are configured as enabled, log a warning and use the configured provider |
| 26 | 26 | if ($recaptchaEnabled && $turnstileEnabled) { |
@@ -33,8 +33,8 @@ discard block |
||
| 33 | 33 | |
| 34 | 34 | // Default to reCAPTCHA |
| 35 | 35 | return $recaptchaEnabled || config('captcha.enabled') === true |
| 36 | - && ! empty(config('captcha.sitekey')) |
|
| 37 | - && ! empty(config('captcha.secret')); |
|
| 36 | + && !empty(config('captcha.sitekey')) |
|
| 37 | + && !empty(config('captcha.secret')); |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | /** |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | */ |
| 51 | 51 | public static function display(array $attributes = []): string |
| 52 | 52 | { |
| 53 | - if (! self::isEnabled()) { |
|
| 53 | + if (!self::isEnabled()) { |
|
| 54 | 54 | return ''; |
| 55 | 55 | } |
| 56 | 56 | |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | */ |
| 70 | 70 | public static function renderJs(): string |
| 71 | 71 | { |
| 72 | - if (! self::isEnabled()) { |
|
| 72 | + if (!self::isEnabled()) { |
|
| 73 | 73 | return ''; |
| 74 | 74 | } |
| 75 | 75 | |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | */ |
| 103 | 103 | public static function getValidationRules(): array |
| 104 | 104 | { |
| 105 | - if (! self::isEnabled()) { |
|
| 105 | + if (!self::isEnabled()) { |
|
| 106 | 106 | return []; |
| 107 | 107 | } |
| 108 | 108 | |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | |
| 61 | 61 | $orderByUrls = []; |
| 62 | 62 | foreach ($releases->getBrowseOrdering() as $orderType) { |
| 63 | - $orderByUrls['orderby'.$orderType] = url('/search?search='.htmlentities($searchString['searchname'], ENT_QUOTES | ENT_HTML5).'&t='.implode(',', $categoryID).'&ob='.$orderType); |
|
| 63 | + $orderByUrls['orderby'.$orderType] = url('/search?search='.htmlentities($searchString['searchname'], ENT_QUOTES|ENT_HTML5).'&t='.implode(',', $categoryID).'&ob='.$orderType); |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | $rslt = $releases->search( |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | if ($searchType !== 'basic' && $request->missing('id') && $request->missing('subject') && $request->anyFilled(['searchadvr', 'searchadvsubject', 'searchadvfilename', 'searchadvposter', 'minage', 'maxage', 'group', 'minsize', 'maxsize', 'search'])) { |
| 137 | 137 | $orderByString = ''; |
| 138 | 138 | foreach ($searchVars as $searchVarKey => $searchVar) { |
| 139 | - $orderByString .= "&$searchVarKey=".htmlentities($searchVar, ENT_QUOTES | ENT_HTML5); |
|
| 139 | + $orderByString .= "&$searchVarKey=".htmlentities($searchVar, ENT_QUOTES|ENT_HTML5); |
|
| 140 | 140 | } |
| 141 | 141 | $orderByString = ltrim($orderByString, '&'); |
| 142 | 142 | |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | // Add country data to each user based on their host IP |
| 57 | 57 | foreach ($results as $user) { |
| 58 | 58 | $position = null; |
| 59 | - if (! empty($user->host) && filter_var($user->host, FILTER_VALIDATE_IP)) { |
|
| 59 | + if (!empty($user->host) && filter_var($user->host, FILTER_VALIDATE_IP)) { |
|
| 60 | 60 | $position = Location::get($user->host); |
| 61 | 61 | } |
| 62 | 62 | $user->country_name = $position ? $position->countryName : null; |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | // Handle rolechangedate - update if has value, clear if empty |
| 156 | 156 | if ($request->has('rolechangedate')) { |
| 157 | 157 | $roleChangeDate = $request->input('rolechangedate'); |
| 158 | - if (! empty($roleChangeDate)) { |
|
| 158 | + if (!empty($roleChangeDate)) { |
|
| 159 | 159 | User::updateUserRoleChangeDate($editedUser->id, $roleChangeDate); |
| 160 | 160 | } else { |
| 161 | 161 | // Clear the rolechangedate if empty string is provided |
@@ -62,7 +62,7 @@ |
||
| 62 | 62 | // convert from a string array to an int array, filtering out empty values |
| 63 | 63 | $books_selected = array_map(fn ($value) => (int) trim($value), array_filter($books_selected)); |
| 64 | 64 | |
| 65 | - $compress_headers_warning = ! str_contains(config('settings.nntp_server'), 'astra') ? 'compress_headers_warning' : ''; |
|
| 65 | + $compress_headers_warning = !str_contains(config('settings.nntp_server'), 'astra') ? 'compress_headers_warning' : ''; |
|
| 66 | 66 | |
| 67 | 67 | $this->viewData = array_merge($this->viewData, [ |
| 68 | 68 | 'error' => $error, |