@@ -323,7 +323,7 @@ |
||
323 | 323 | { |
324 | 324 | return Registry::cache()->file()->remember('whois-asn-' . $asn, function () use ($asn): array { |
325 | 325 | $ranges = $this->network_service->findIpRangesForAsn($asn); |
326 | - $mapper = static fn (string $range): RangeInterface|null => Factory::parseRangeString($range); |
|
326 | + $mapper = static fn (string $range): RangeInterface | null => Factory::parseRangeString($range); |
|
327 | 327 | $ranges = array_map($mapper, $ranges); |
328 | 328 | |
329 | 329 | return array_filter($ranges); |
@@ -57,52 +57,52 @@ |
||
57 | 57 | * Instead, the list from version 1.26 is copied here. |
58 | 58 | */ |
59 | 59 | public const array AI_ROBOTS = [ |
60 | - 'AI2Bot', |
|
61 | - 'Ai2Bot-Dolma', |
|
62 | - 'Amazonbot', |
|
63 | - 'anthropic-ai', |
|
64 | - 'Applebot', |
|
65 | - 'Applebot-Extended', |
|
66 | - 'Brightbot 1.0', |
|
67 | - 'Bytespider', |
|
68 | - 'CCBot', |
|
69 | - 'ChatGPT-User', |
|
70 | - 'Claude-Web', |
|
71 | - 'ClaudeBot', |
|
72 | - 'cohere-ai', |
|
73 | - 'cohere-training-data-crawler', |
|
74 | - 'Crawlspace', |
|
75 | - 'Diffbot', |
|
76 | - 'DuckAssistBot', |
|
77 | - 'FacebookBot', |
|
78 | - 'FriendlyCrawler', |
|
79 | - 'Google-Extended', |
|
80 | - 'GoogleOther', |
|
81 | - 'GoogleOther-Image', |
|
82 | - 'GoogleOther-Video', |
|
83 | - 'GPTBot', |
|
84 | - 'iaskspider/2.0', |
|
85 | - 'ICC-Crawler', |
|
86 | - 'ImagesiftBot', |
|
87 | - 'img2dataset', |
|
88 | - 'ISSCyberRiskCrawler', |
|
89 | - 'Kangaroo Bot', |
|
90 | - 'meta-externalagent', |
|
91 | - 'meta-externalfetcher', |
|
92 | - 'OAI-SearchBot', |
|
93 | - 'omgili', |
|
94 | - 'omgilibot', |
|
95 | - 'PanguBot', |
|
96 | - 'PerplexityBot', |
|
97 | - 'PetalBot', |
|
98 | - 'Scrapy', |
|
99 | - 'SemrushBot-OCOB', |
|
100 | - 'SemrushBot-SWA', |
|
101 | - 'Sidetrade indexer bot', |
|
102 | - 'Timpibot', |
|
103 | - 'VelenPublicWebCrawler', |
|
104 | - 'Webzio-Extended', |
|
105 | - 'YouBot', |
|
60 | + 'AI2Bot', |
|
61 | + 'Ai2Bot-Dolma', |
|
62 | + 'Amazonbot', |
|
63 | + 'anthropic-ai', |
|
64 | + 'Applebot', |
|
65 | + 'Applebot-Extended', |
|
66 | + 'Brightbot 1.0', |
|
67 | + 'Bytespider', |
|
68 | + 'CCBot', |
|
69 | + 'ChatGPT-User', |
|
70 | + 'Claude-Web', |
|
71 | + 'ClaudeBot', |
|
72 | + 'cohere-ai', |
|
73 | + 'cohere-training-data-crawler', |
|
74 | + 'Crawlspace', |
|
75 | + 'Diffbot', |
|
76 | + 'DuckAssistBot', |
|
77 | + 'FacebookBot', |
|
78 | + 'FriendlyCrawler', |
|
79 | + 'Google-Extended', |
|
80 | + 'GoogleOther', |
|
81 | + 'GoogleOther-Image', |
|
82 | + 'GoogleOther-Video', |
|
83 | + 'GPTBot', |
|
84 | + 'iaskspider/2.0', |
|
85 | + 'ICC-Crawler', |
|
86 | + 'ImagesiftBot', |
|
87 | + 'img2dataset', |
|
88 | + 'ISSCyberRiskCrawler', |
|
89 | + 'Kangaroo Bot', |
|
90 | + 'meta-externalagent', |
|
91 | + 'meta-externalfetcher', |
|
92 | + 'OAI-SearchBot', |
|
93 | + 'omgili', |
|
94 | + 'omgilibot', |
|
95 | + 'PanguBot', |
|
96 | + 'PerplexityBot', |
|
97 | + 'PetalBot', |
|
98 | + 'Scrapy', |
|
99 | + 'SemrushBot-OCOB', |
|
100 | + 'SemrushBot-SWA', |
|
101 | + 'Sidetrade indexer bot', |
|
102 | + 'Timpibot', |
|
103 | + 'VelenPublicWebCrawler', |
|
104 | + 'Webzio-Extended', |
|
105 | + 'YouBot', |
|
106 | 106 | ]; |
107 | 107 | |
108 | 108 | // Other bad robots - SEO optimisers, advertisers, etc. This list is shared with robots.txt. |
@@ -115,7 +115,7 @@ |
||
115 | 115 | ->flatten(); |
116 | 116 | |
117 | 117 | // Don't show family meta-data tags |
118 | - $exclude_facts = new Collection(['FAM:CHAN', 'FAM:_UID', 'FAM:UID', 'FAM:SUBM']); |
|
118 | + $exclude_facts = new Collection(['FAM:CHAN', 'FAM:_UID', 'FAM:UID', 'FAM:SUBM']); |
|
119 | 119 | // Don't show tags that are shown in tabs or sidebars |
120 | 120 | $exclude_facts = $exclude_facts->merge($sidebar_facts)->merge($tab_facts); |
121 | 121 |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | string $line_endings, |
108 | 108 | string $filename, |
109 | 109 | string $format, |
110 | - Collection|null $records = null |
|
110 | + Collection | null $records = null |
|
111 | 111 | ): ResponseInterface { |
112 | 112 | $access_level = self::ACCESS_LEVELS[$privacy]; |
113 | 113 | |
@@ -177,9 +177,9 @@ discard block |
||
177 | 177 | string $encoding = UTF8::NAME, |
178 | 178 | int $access_level = Auth::PRIV_HIDE, |
179 | 179 | string $line_endings = 'CRLF', |
180 | - Collection|null $records = null, |
|
181 | - ZipArchive|FilesystemOperator|null $zip_filesystem = null, |
|
182 | - string|null $media_path = null |
|
180 | + Collection | null $records = null, |
|
181 | + ZipArchive | FilesystemOperator | null $zip_filesystem = null, |
|
182 | + string | null $media_path = null |
|
183 | 183 | ) { |
184 | 184 | $stream = fopen('php://memory', 'wb+'); |
185 | 185 |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | /** |
165 | 165 | * @param list<int> $parent_place_ids |
166 | 166 | */ |
167 | - public function deleteUnusedLocations(int|null $parent_location_id, array $parent_place_ids): void |
|
167 | + public function deleteUnusedLocations(int | null $parent_location_id, array $parent_place_ids): void |
|
168 | 168 | { |
169 | 169 | if ($parent_location_id === null) { |
170 | 170 | $location_query = DB::table('place_location') |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | * |
200 | 200 | * @return Collection<int,object{id:int,key:string,place:string,latitude:float|null,longitude:float|null,child_count:int,no_coord:int}> |
201 | 201 | */ |
202 | - public function getPlaceListLocation(int|null $parent_id): Collection |
|
202 | + public function getPlaceListLocation(int | null $parent_id): Collection |
|
203 | 203 | { |
204 | 204 | $expression = |
205 | 205 | DB::prefix('p1') . '.place IS NOT NULL AND ' . DB::prefix('p1') . '.latitude IS NULL OR ' . |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | 'child_count' => (int) $row->child_count, |
249 | 249 | 'no_coord' => (int) $row->no_coord, |
250 | 250 | ]) |
251 | - ->sort(static fn (object $x, object $y): int => I18N::comparator()($x->place, $y->place)); |
|
251 | + ->sort(static fn (object $x, object $y) : int => I18N::comparator()($x->place, $y->place)); |
|
252 | 252 | } |
253 | 253 | |
254 | 254 | public function writeLatitude(float $latitude): string |
@@ -70,11 +70,11 @@ discard block |
||
70 | 70 | $default_url = route(HomePage::class); |
71 | 71 | $username = Validator::parsedBody($request)->string('username'); |
72 | 72 | $password = Validator::parsedBody($request)->string('password', ''); |
73 | - $loginstage = Validator::parsedBody($request)->string('loginstage', '1'); |
|
73 | + $loginstage = Validator::parsedBody($request)->string('loginstage', '1'); |
|
74 | 74 | $codemfa = Validator::parsedBody($request)->string('codemfa', ''); |
75 | 75 | $url = Validator::parsedBody($request)->isLocalUrl()->string('url', $default_url); |
76 | 76 | $mfastatus = Validator::parsedBody($request)->string('mfastatus', '0'); |
77 | - $mfasuccess = Validator::parsedBody($request)->string('mfasuccess', '0'); |
|
77 | + $mfasuccess = Validator::parsedBody($request)->string('mfasuccess', '0'); |
|
78 | 78 | |
79 | 79 | try { |
80 | 80 | $user = $this->user_service->findByIdentifier($username); |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | Log::addAuthenticationLog('Login failed (not approved by admin): ' . $username); |
154 | 154 | throw new Exception(I18N::translate('This account has not been approved. Please wait for an administrator to approve it.')); |
155 | 155 | } |
156 | - if ($user->getPreference(UserInterface::PREF_IS_STATUS_MFA) === "1" && (bool)Site::getPreference('SHOW_2FA_OPTION')) { |
|
156 | + if ($user->getPreference(UserInterface::PREF_IS_STATUS_MFA) === "1" && (bool) Site::getPreference('SHOW_2FA_OPTION')) { |
|
157 | 157 | # MFA switched on for site and has been enabled by user |
158 | 158 | return "1"; |
159 | 159 | } else { |
@@ -31,11 +31,11 @@ |
||
31 | 31 | // If the form is completed faster than this, then suspect a robot. |
32 | 32 | // private const float MINIMUM_FORM_TIME = 3.0; |
33 | 33 | /** |
34 | - * Generate a QR code image based on 2FA secret and return both. |
|
35 | - * |
|
36 | - * @param UserInterface $user |
|
37 | - * @return array<string, mixed> |
|
38 | - */ |
|
34 | + * Generate a QR code image based on 2FA secret and return both. |
|
35 | + * |
|
36 | + * @param UserInterface $user |
|
37 | + * @return array<string, mixed> |
|
38 | + */ |
|
39 | 39 | |
40 | 40 | public function genQRcode(UserInterface $user): array |
41 | 41 | { |
@@ -263,12 +263,12 @@ |
||
263 | 263 | return $this; |
264 | 264 | } |
265 | 265 | /** |
266 | - * Validate a supplied 2fa code |
|
267 | - * |
|
268 | - * @param string $codemfa |
|
269 | - * |
|
270 | - * @return bool |
|
271 | - */ |
|
266 | + * Validate a supplied 2fa code |
|
267 | + * |
|
268 | + * @param string $codemfa |
|
269 | + * |
|
270 | + * @return bool |
|
271 | + */ |
|
272 | 272 | public function checkMfaCode(string $codemfa): bool |
273 | 273 | { |
274 | 274 | /** @var string $secret */ |
@@ -276,7 +276,7 @@ |
||
276 | 276 | ->where('user_id', '=', $this->id()) |
277 | 277 | ->value('secret'); |
278 | 278 | $google2fa = new Google2FA(); |
279 | - if ((bool)$google2fa->verifyKey($secret, $codemfa)) { |
|
279 | + if ((bool) $google2fa->verifyKey($secret, $codemfa)) { |
|
280 | 280 | return true; |
281 | 281 | } |
282 | 282 | return false; |