@@ -32,7 +32,7 @@ |
||
| 32 | 32 | 'rate_limit' => $rateLimit, |
| 33 | 33 | ] |
| 34 | 34 | ); |
| 35 | - if (! empty(config('mail.from.address') && File::isFile(base_path().'/_install/install.lock'))) { |
|
| 35 | + if (!empty(config('mail.from.address') && File::isFile(base_path().'/_install/install.lock'))) { |
|
| 36 | 36 | SendNewRegisteredAccountMail::dispatch($user)->onQueue('newreg'); |
| 37 | 37 | SendWelcomeEmail::dispatch($user)->onQueue('welcomeemails'); |
| 38 | 38 | UserVerification::generate($user); |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | */ |
| 31 | 31 | public function register(): void |
| 32 | 32 | { |
| 33 | - $this->reportable(function (Throwable $e) { |
|
| 33 | + $this->reportable(function(Throwable $e) { |
|
| 34 | 34 | if (app()->bound('sentry')) { |
| 35 | 35 | app('sentry')->captureException($e); |
| 36 | 36 | } |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | |
| 19 | 19 | $this->hideSensitiveRequestDetails(); |
| 20 | 20 | |
| 21 | - Telescope::filter(function (IncomingEntry $entry) { |
|
| 21 | + Telescope::filter(function(IncomingEntry $entry) { |
|
| 22 | 22 | if ($this->app->isLocal() || config('telescope.full_enabled_in_production') === true) { |
| 23 | 23 | return true; |
| 24 | 24 | } |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | */ |
| 56 | 56 | protected function gate(): void |
| 57 | 57 | { |
| 58 | - Gate::define('viewTelescope', function ($user) { |
|
| 58 | + Gate::define('viewTelescope', function($user) { |
|
| 59 | 59 | return in_array($user->email, [ |
| 60 | 60 | config('nntmux.admin_email'), |
| 61 | 61 | ], true); |
@@ -27,7 +27,7 @@ |
||
| 27 | 27 | */ |
| 28 | 28 | protected function gate(): void |
| 29 | 29 | { |
| 30 | - Gate::define('viewHorizon', function ($user) { |
|
| 30 | + Gate::define('viewHorizon', function($user) { |
|
| 31 | 31 | return in_array($user->email, [ |
| 32 | 32 | config('nntmux.admin_email'), |
| 33 | 33 | ], true); |
@@ -58,8 +58,7 @@ discard block |
||
| 58 | 58 | for ($chr = 0; $chr < $encodedLength; $chr++) { |
| 59 | 59 | $decoded .= ( |
| 60 | 60 | $encoded[$chr] === '=' ? |
| 61 | - \chr((\ord($encoded[$chr]) - 42) % 256) : |
|
| 62 | - \chr((((\ord($encoded[++$chr]) - 64) % 256) - 42) % 256) |
|
| 61 | + \chr((\ord($encoded[$chr]) - 42) % 256) : \chr((((\ord($encoded[++$chr]) - 64) % 256) - 42) % 256) |
|
| 63 | 62 | ); |
| 64 | 63 | } |
| 65 | 64 | |
@@ -113,8 +112,7 @@ discard block |
||
| 113 | 112 | for ($chr = 0; $chr < $length; $chr++) { |
| 114 | 113 | $text .= ( |
| 115 | 114 | $input[$chr] === '=' ? |
| 116 | - \chr((((\ord($input[++$chr]) - 64) % 256) - 42) % 256) : |
|
| 117 | - \chr((\ord($input[$chr]) - 42) % 256) |
|
| 115 | + \chr((((\ord($input[++$chr]) - 64) % 256) - 42) % 256) : \chr((\ord($input[$chr]) - 42) % 256) |
|
| 118 | 116 | ); |
| 119 | 117 | } |
| 120 | 118 | } |
@@ -9,13 +9,13 @@ |
||
| 9 | 9 | { |
| 10 | 10 | protected function canPassWithoutCheckingOTP(): bool |
| 11 | 11 | { |
| 12 | - if (! $this->getUser()->passwordSecurity) { |
|
| 12 | + if (!$this->getUser()->passwordSecurity) { |
|
| 13 | 13 | return true; |
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | return |
| 17 | - ! $this->getUser()->passwordSecurity->google2fa_enable || |
|
| 18 | - ! $this->isEnabled() || |
|
| 17 | + !$this->getUser()->passwordSecurity->google2fa_enable || |
|
| 18 | + !$this->isEnabled() || |
|
| 19 | 19 | $this->noUserIsAuthenticated() || |
| 20 | 20 | $this->twoFactorAuthStillValid(); |
| 21 | 21 | } |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | $manticore->truncateRTIndex(Arr::wrap('releases_rt')); |
| 65 | 65 | $data = []; |
| 66 | 66 | $total = Release::count(); |
| 67 | - if (! $total) { |
|
| 67 | + if (!$total) { |
|
| 68 | 68 | $this->warn('Releases table is empty. Nothing to do.'); |
| 69 | 69 | exit(); |
| 70 | 70 | } |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | ->select(['releases.id', 'releases.name', 'releases.searchname', 'releases.fromname', 'releases.categories_id']) |
| 85 | 85 | ->selectRaw('IFNULL(GROUP_CONCAT(release_files.name SEPARATOR " "),"") filename') |
| 86 | 86 | ->groupBy('id') |
| 87 | - ->chunk($max, function ($releases) use ($manticore, $bar, $data) { |
|
| 87 | + ->chunk($max, function($releases) use ($manticore, $bar, $data) { |
|
| 88 | 88 | foreach ($releases as $r) { |
| 89 | 89 | $data[] = [ |
| 90 | 90 | 'id' => $r->id, |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | $data = []; |
| 113 | 113 | |
| 114 | 114 | $total = Predb::count(); |
| 115 | - if (! $total) { |
|
| 115 | + if (!$total) { |
|
| 116 | 116 | $this->warn('PreDB table is empty. Nothing to do.'); |
| 117 | 117 | exit(); |
| 118 | 118 | } |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | ->select(['id', 'title', 'filename', 'source']) |
| 130 | 130 | ->groupBy('id') |
| 131 | 131 | ->orderBy('id') |
| 132 | - ->chunk($max, function ($pre) use ($manticore, $bar, $data) { |
|
| 132 | + ->chunk($max, function($pre) use ($manticore, $bar, $data) { |
|
| 133 | 133 | foreach ($pre as $p) { |
| 134 | 134 | $data[] = [ |
| 135 | 135 | 'id' => $p->id, |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | $data = ['body' => []]; |
| 152 | 152 | $elastic = new ElasticSearchSiteSearch(); |
| 153 | 153 | $total = Release::count(); |
| 154 | - if (! $total) { |
|
| 154 | + if (!$total) { |
|
| 155 | 155 | $this->warn('Could not get database information for releases table.'); |
| 156 | 156 | exit(); |
| 157 | 157 | } |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | ->select(['releases.id', 'releases.name', 'releases.searchname', 'releases.fromname', 'releases.categories_id', 'releases.postdate']) |
| 170 | 170 | ->selectRaw('IFNULL(GROUP_CONCAT(release_files.name SEPARATOR " "),"") filename') |
| 171 | 171 | ->groupBy('id') |
| 172 | - ->chunk($max, function ($releases) use ($bar, $data) { |
|
| 172 | + ->chunk($max, function($releases) use ($bar, $data) { |
|
| 173 | 173 | foreach ($releases as $r) { |
| 174 | 174 | $searchName = str_replace(['.', '-'], ' ', $r->searchname); |
| 175 | 175 | $data['body'][] = [ |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | $data = ['body' => []]; |
| 203 | 203 | $elastic = new ElasticSearchSiteSearch(); |
| 204 | 204 | $total = Predb::count(); |
| 205 | - if (! $total) { |
|
| 205 | + if (!$total) { |
|
| 206 | 206 | $this->warn('Could not get database information for predb table.'); |
| 207 | 207 | exit(); |
| 208 | 208 | } |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | ->select(['id', 'title', 'filename', 'source']) |
| 220 | 220 | ->groupBy('id') |
| 221 | 221 | ->orderBy('id') |
| 222 | - ->chunk($max, function ($pre) use ($bar, $data) { |
|
| 222 | + ->chunk($max, function($pre) use ($bar, $data) { |
|
| 223 | 223 | foreach ($pre as $p) { |
| 224 | 224 | $data['body'][] = [ |
| 225 | 225 | 'index' => [ |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | } |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | - if (! $error && $this->addAdminUser()) { |
|
| 73 | + if (!$error && $this->addAdminUser()) { |
|
| 74 | 74 | File::put(base_path().'/_install/install.lock', 'application install locked on '.now()); |
| 75 | 75 | $this->info('Generating application key'); |
| 76 | 76 | $this->call('key:generate', ['--force' => true]); |
@@ -99,15 +99,15 @@ discard block |
||
| 99 | 99 | $unrar_path = $tmp_path.'unrar/'; |
| 100 | 100 | |
| 101 | 101 | $nzbPathCheck = File::isWritable($nzb_path); |
| 102 | - if (! $nzbPathCheck) { |
|
| 102 | + if (!$nzbPathCheck) { |
|
| 103 | 103 | $this->warn($nzb_path.' is not writable. Please fix folder permissions'); |
| 104 | 104 | |
| 105 | 105 | return false; |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | - if (! file_exists($unrar_path)) { |
|
| 108 | + if (!file_exists($unrar_path)) { |
|
| 109 | 109 | $this->info('Creating missing '.$unrar_path.' folder'); |
| 110 | - if (! @File::makeDirectory($unrar_path) && ! File::isDirectory($unrar_path)) { |
|
| 110 | + if (!@File::makeDirectory($unrar_path) && !File::isDirectory($unrar_path)) { |
|
| 111 | 111 | throw new \RuntimeException('Unable to create '.$unrar_path.' folder'); |
| 112 | 112 | } |
| 113 | 113 | $this->info('Folder '.$unrar_path.' successfully created'); |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | $coversPathCheck = File::isWritable($covers_path); |
| 123 | - if (! $coversPathCheck) { |
|
| 123 | + if (!$coversPathCheck) { |
|
| 124 | 124 | $this->warn($covers_path.' is not writable. Please fix folder permissions'); |
| 125 | 125 | |
| 126 | 126 | return false; |
@@ -20,9 +20,9 @@ |
||
| 20 | 20 | * @var int |
| 21 | 21 | */ |
| 22 | 22 | protected $headers = |
| 23 | - Request::HEADER_X_FORWARDED_FOR | |
|
| 24 | - Request::HEADER_X_FORWARDED_HOST | |
|
| 25 | - Request::HEADER_X_FORWARDED_PORT | |
|
| 26 | - Request::HEADER_X_FORWARDED_PROTO | |
|
| 23 | + Request::HEADER_X_FORWARDED_FOR| |
|
| 24 | + Request::HEADER_X_FORWARDED_HOST| |
|
| 25 | + Request::HEADER_X_FORWARDED_PORT| |
|
| 26 | + Request::HEADER_X_FORWARDED_PROTO| |
|
| 27 | 27 | Request::HEADER_X_FORWARDED_AWS_ELB; |
| 28 | 28 | } |