@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | */ |
38 | 38 | public function create(Request $request) |
39 | 39 | { |
40 | - if (! \defined('STDOUT')) { |
|
40 | + if (!\defined('STDOUT')) { |
|
41 | 41 | \define('STDOUT', fopen('php://stdout', 'wb')); |
42 | 42 | } |
43 | 43 | $this->setAdminPrefs(); |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | if ($_FILES['cover']['size'] > 0) { |
109 | 109 | $tmpName = $_FILES['cover']['tmp_name']; |
110 | 110 | $file_info = getimagesize($tmpName); |
111 | - if (! empty($file_info)) { |
|
111 | + if (!empty($file_info)) { |
|
112 | 112 | move_uploaded_file($_FILES['cover']['tmp_name'], $coverLoc); |
113 | 113 | } |
114 | 114 | } |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | if ($_FILES['backdrop']['size'] > 0) { |
117 | 117 | $tmpName = $_FILES['backdrop']['tmp_name']; |
118 | 118 | $file_info = getimagesize($tmpName); |
119 | - if (! empty($file_info)) { |
|
119 | + if (!empty($file_info)) { |
|
120 | 120 | move_uploaded_file($_FILES['backdrop']['tmp_name'], $backdropLoc); |
121 | 121 | } |
122 | 122 | } |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | $id = $request->input('id'); |
49 | 49 | $mus = $music->getMusicInfo($id); |
50 | 50 | |
51 | - if (! $mus) { |
|
51 | + if (!$mus) { |
|
52 | 52 | $this->show404(); |
53 | 53 | } |
54 | 54 | |
@@ -59,14 +59,14 @@ discard block |
||
59 | 59 | if ($_FILES['cover']['size'] > 0) { |
60 | 60 | $tmpName = $_FILES['cover']['tmp_name']; |
61 | 61 | $file_info = getimagesize($tmpName); |
62 | - if (! empty($file_info)) { |
|
62 | + if (!empty($file_info)) { |
|
63 | 63 | move_uploaded_file($_FILES['cover']['tmp_name'], $coverLoc); |
64 | 64 | } |
65 | 65 | } |
66 | 66 | |
67 | 67 | $request->merge(['cover' => file_exists($coverLoc) ? 1 : 0]); |
68 | - $request->merge(['salesrank' => (empty($request->input('salesrank')) || ! ctype_digit($request->input('salesrank'))) ? 'null' : $request->input('salesrank')]); |
|
69 | - $request->merge(['releasedate' => (empty($request->input('releasedate')) || ! strtotime($request->input('releasedate'))) ? $mus['releasedate'] : Carbon::parse($request->input('releasedate'))->timestamp]); |
|
68 | + $request->merge(['salesrank' => (empty($request->input('salesrank')) || !ctype_digit($request->input('salesrank'))) ? 'null' : $request->input('salesrank')]); |
|
69 | + $request->merge(['releasedate' => (empty($request->input('releasedate')) || !strtotime($request->input('releasedate'))) ? $mus['releasedate'] : Carbon::parse($request->input('releasedate'))->timestamp]); |
|
70 | 70 | |
71 | 71 | $music->update($id, $request->input('title'), $request->input('asin'), $request->input('url'), $request->input('salesrank'), $request->input('artist'), $request->input('publisher'), $request->input('releasedate'), $request->input('year'), $request->input('tracks'), $request->input('cover'), $request->input('genre')); |
72 | 72 |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | $title = $meta_title = 'AniDB List'; |
21 | 21 | |
22 | 22 | $aname = ''; |
23 | - if ($request->has('animetitle') && ! empty($request->input('animetitle'))) { |
|
23 | + if ($request->has('animetitle') && !empty($request->input('animetitle'))) { |
|
24 | 24 | $aname = $request->input('animetitle'); |
25 | 25 | } |
26 | 26 | |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | |
74 | 74 | case 'view': |
75 | 75 | default: |
76 | - if (! empty($id)) { |
|
76 | + if (!empty($id)) { |
|
77 | 77 | $this->title = 'AniDB Edit'; |
78 | 78 | $AniDBAPIArray = $AniDB->getAnimeInfo($id); |
79 | 79 | $this->smarty->assign('anime', $AniDBAPIArray); |
@@ -57,13 +57,13 @@ |
||
57 | 57 | $movies[] = $result; |
58 | 58 | } |
59 | 59 | |
60 | - $title = ($request->has('title') && ! empty($request->input('title'))) ? stripslashes($request->input('title')) : ''; |
|
60 | + $title = ($request->has('title') && !empty($request->input('title'))) ? stripslashes($request->input('title')) : ''; |
|
61 | 61 | $this->smarty->assign('title', stripslashes($title)); |
62 | 62 | |
63 | - $actors = ($request->has('actors') && ! empty($request->input('actors'))) ? stripslashes($request->input('actors')) : ''; |
|
63 | + $actors = ($request->has('actors') && !empty($request->input('actors'))) ? stripslashes($request->input('actors')) : ''; |
|
64 | 64 | $this->smarty->assign('actors', $actors); |
65 | 65 | |
66 | - $director = ($request->has('director') && ! empty($request->input('director'))) ? stripslashes($request->input('director')) : ''; |
|
66 | + $director = ($request->has('director') && !empty($request->input('director'))) ? stripslashes($request->input('director')) : ''; |
|
67 | 67 | $this->smarty->assign('director', $director); |
68 | 68 | |
69 | 69 | $genres = $adult->getAllGenres(true); |
@@ -16,7 +16,7 @@ |
||
16 | 16 | if ($request->has('action') && (int) $request->input('action') === 1 && $request->has('emailto')) { |
17 | 17 | $emailTo = $request->input('emailto'); |
18 | 18 | $ret = User::sendInvite(url('/'), $this->userdata->id, $emailTo); |
19 | - if (! $ret) { |
|
19 | + if (!$ret) { |
|
20 | 20 | echo 'Invite not sent.'; |
21 | 21 | } else { |
22 | 22 | echo 'Invite sent. Alternatively paste them following link to register - '.$ret; |
@@ -38,9 +38,9 @@ discard block |
||
38 | 38 | |
39 | 39 | $show = Video::getByVideoID($id); |
40 | 40 | |
41 | - if (! $show) { |
|
41 | + if (!$show) { |
|
42 | 42 | $this->smarty->assign('nodata', 'No video information for this series.'); |
43 | - } elseif (! $rel) { |
|
43 | + } elseif (!$rel) { |
|
44 | 44 | $this->smarty->assign('nodata', 'No releases for this series.'); |
45 | 45 | } else { |
46 | 46 | $myshows = UserSerie::getShow($this->userdata->id, $show['id']); |
@@ -67,11 +67,11 @@ discard block |
||
67 | 67 | $seriestitles = $seriessummary = $seriescountry = []; |
68 | 68 | $seriestitles[] = $show['title']; |
69 | 69 | |
70 | - if (! empty($show['summary'])) { |
|
70 | + if (!empty($show['summary'])) { |
|
71 | 71 | $seriessummary[] = $show['summary']; |
72 | 72 | } |
73 | 73 | |
74 | - if (! empty($show['countries_id'])) { |
|
74 | + if (!empty($show['countries_id'])) { |
|
75 | 75 | $seriescountry[] = $show['countries_id']; |
76 | 76 | } |
77 | 77 | |
@@ -105,9 +105,9 @@ discard block |
||
105 | 105 | } else { |
106 | 106 | $letter = ($id && preg_match('/^(0\-9|[A-Z])$/i', $id)) ? $id : '0-9'; |
107 | 107 | |
108 | - $showname = ($request->has('title') && ! empty($request->input('title'))) ? $request->input('title') : ''; |
|
108 | + $showname = ($request->has('title') && !empty($request->input('title'))) ? $request->input('title') : ''; |
|
109 | 109 | |
110 | - if ($showname !== '' && ! $id) { |
|
110 | + if ($showname !== '' && !$id) { |
|
111 | 111 | $letter = ''; |
112 | 112 | } |
113 | 113 |
@@ -11,7 +11,7 @@ |
||
11 | 11 | */ |
12 | 12 | public function rules(): array |
13 | 13 | { |
14 | - if (config('captcha.enabled') === true && (! empty(config('captcha.secret')) && ! empty(config('captcha.sitekey')))) { |
|
14 | + if (config('captcha.enabled') === true && (!empty(config('captcha.secret')) && !empty(config('captcha.sitekey')))) { |
|
15 | 15 | return [ |
16 | 16 | 'g-recaptcha-response' => [ |
17 | 17 | 'required', |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | use Symfony\Component\Process\Process; |
17 | 17 | use Zip as ZipStream; |
18 | 18 | |
19 | -if (! function_exists('getRawHtml')) { |
|
19 | +if (!function_exists('getRawHtml')) { |
|
20 | 20 | /** |
21 | 21 | * @param bool $cookie |
22 | 22 | * @return bool|mixed|string |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | } |
52 | 52 | } |
53 | 53 | |
54 | -if (! function_exists('makeFieldLinks')) { |
|
54 | +if (!function_exists('makeFieldLinks')) { |
|
55 | 55 | /** |
56 | 56 | * @return string |
57 | 57 | * |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | } |
82 | 82 | } |
83 | 83 | |
84 | -if (! function_exists('getUserBrowseOrder')) { |
|
84 | +if (!function_exists('getUserBrowseOrder')) { |
|
85 | 85 | /** |
86 | 86 | * @param string $orderBy |
87 | 87 | */ |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | } |
108 | 108 | } |
109 | 109 | |
110 | -if (! function_exists('getUserBrowseOrdering')) { |
|
110 | +if (!function_exists('getUserBrowseOrdering')) { |
|
111 | 111 | function getUserBrowseOrdering(): array |
112 | 112 | { |
113 | 113 | return [ |
@@ -137,21 +137,21 @@ discard block |
||
137 | 137 | } |
138 | 138 | } |
139 | 139 | |
140 | -if (! function_exists('createGUID')) { |
|
140 | +if (!function_exists('createGUID')) { |
|
141 | 141 | /** |
142 | 142 | * @throws Exception |
143 | 143 | */ |
144 | 144 | function createGUID(): string |
145 | 145 | { |
146 | 146 | $data = random_bytes(16); |
147 | - $data[6] = \chr(\ord($data[6]) & 0x0F | 0x40); // set version to 0100 |
|
148 | - $data[8] = \chr(\ord($data[8]) & 0x3F | 0x80); // set bits 6-7 to 10 |
|
147 | + $data[6] = \chr(\ord($data[6]) & 0x0F|0x40); // set version to 0100 |
|
148 | + $data[8] = \chr(\ord($data[8]) & 0x3F|0x80); // set bits 6-7 to 10 |
|
149 | 149 | |
150 | 150 | return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(sodium_bin2hex($data), 4)); |
151 | 151 | } |
152 | 152 | } |
153 | 153 | |
154 | -if (! function_exists('getSimilarName')) { |
|
154 | +if (!function_exists('getSimilarName')) { |
|
155 | 155 | /** |
156 | 156 | * @param string $name |
157 | 157 | */ |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | } |
162 | 162 | } |
163 | 163 | |
164 | -if (! function_exists('color')) { |
|
164 | +if (!function_exists('color')) { |
|
165 | 165 | /** |
166 | 166 | * @param string $string |
167 | 167 | */ |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | } |
172 | 172 | } |
173 | 173 | |
174 | -if (! function_exists('human_filesize')) { |
|
174 | +if (!function_exists('human_filesize')) { |
|
175 | 175 | /** |
176 | 176 | * @param int $decimals |
177 | 177 | */ |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | } |
185 | 185 | } |
186 | 186 | |
187 | -if (! function_exists('bcdechex')) { |
|
187 | +if (!function_exists('bcdechex')) { |
|
188 | 188 | /** |
189 | 189 | * @return string |
190 | 190 | */ |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | } |
202 | 202 | } |
203 | 203 | |
204 | -if (! function_exists('runCmd')) { |
|
204 | +if (!function_exists('runCmd')) { |
|
205 | 205 | /** |
206 | 206 | * Run CLI command. |
207 | 207 | * |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | } |
230 | 230 | } |
231 | 231 | |
232 | -if (! function_exists('escapeString')) { |
|
232 | +if (!function_exists('escapeString')) { |
|
233 | 233 | /** |
234 | 234 | * @return string |
235 | 235 | */ |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | } |
240 | 240 | } |
241 | 241 | |
242 | -if (! function_exists('realDuration')) { |
|
242 | +if (!function_exists('realDuration')) { |
|
243 | 243 | /** |
244 | 244 | * @return string |
245 | 245 | */ |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | } |
252 | 252 | } |
253 | 253 | |
254 | -if (! function_exists('is_it_json')) { |
|
254 | +if (!function_exists('is_it_json')) { |
|
255 | 255 | /** |
256 | 256 | * @param array|string $isIt |
257 | 257 | * @return bool |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | return $zipped; |
295 | 295 | } |
296 | 296 | |
297 | -if (! function_exists('release_flag')) { |
|
297 | +if (!function_exists('release_flag')) { |
|
298 | 298 | // Function inspired by c0r3@newznabforums adds country flags on the browse page. |
299 | 299 | /** |
300 | 300 | * @param string $text Text to match against. |
@@ -430,10 +430,10 @@ discard block |
||
430 | 430 | |
431 | 431 | return ''; |
432 | 432 | } |
433 | - if (! function_exists('sanitize')) { |
|
433 | + if (!function_exists('sanitize')) { |
|
434 | 434 | function sanitize(array|string $phrases, array $doNotSanitize = []): string |
435 | 435 | { |
436 | - if (! is_array($phrases)) { |
|
436 | + if (!is_array($phrases)) { |
|
437 | 437 | $wordArray = explode(' ', str_replace('.', ' ', $phrases)); |
438 | 438 | } else { |
439 | 439 | $wordArray = $phrases; |
@@ -444,9 +444,9 @@ discard block |
||
444 | 444 | foreach ($wordArray as $words) { |
445 | 445 | $words = preg_split('/\s+/', $words); |
446 | 446 | foreach ($words as $st) { |
447 | - if (Str::startsWith($st, ['!', '+', '-', '?', '*']) && Str::length($st) > 1 && ! preg_match('/([!+?\-*]){2,}/', $st)) { |
|
447 | + if (Str::startsWith($st, ['!', '+', '-', '?', '*']) && Str::length($st) > 1 && !preg_match('/([!+?\-*]){2,}/', $st)) { |
|
448 | 448 | $str = $st; |
449 | - } elseif (Str::endsWith($st, ['+', '-', '?', '*']) && Str::length($st) > 1 && ! preg_match('/([!+?\-*]){2,}/', $st)) { |
|
449 | + } elseif (Str::endsWith($st, ['+', '-', '?', '*']) && Str::length($st) > 1 && !preg_match('/([!+?\-*]){2,}/', $st)) { |
|
450 | 450 | $str = $st; |
451 | 451 | } else { |
452 | 452 | $str = Sanitizer::escape($st, $doNotSanitize); |
@@ -17,7 +17,7 @@ |
||
17 | 17 | public function handle(Request $request, Closure $next): Response |
18 | 18 | { |
19 | 19 | // Force Json accept type on api routes |
20 | - if ($request->is('api/*') && ! Str::contains($request->header('accept'), ['/json', '+json'])) { |
|
20 | + if ($request->is('api/*') && !Str::contains($request->header('accept'), ['/json', '+json'])) { |
|
21 | 21 | $request->headers->set('accept', 'application/json,'.$request->header('accept')); |
22 | 22 | } |
23 | 23 |