jdarwood007 commited on 2024-02-03 15:37:20
Showing 16 changed files, with 2549 additions and 362 deletions.
Lint files
... | ... |
@@ -0,0 +1,31 @@ |
1 |
+on: |
|
2 |
+ push: |
|
3 |
+ branches: |
|
4 |
+ - release-2.1 |
|
5 |
+ pull_request: |
|
6 |
+ |
|
7 |
+name: PHP Check |
|
8 |
+jobs: |
|
9 |
+ php-cs-fixer: |
|
10 |
+ name: PHP-CS-Fixer |
|
11 |
+ runs-on: ubuntu-latest |
|
12 |
+ steps: |
|
13 |
+ - uses: actions/checkout@v4 |
|
14 |
+ |
|
15 |
+ - name: Get changed files |
|
16 |
+ id: changed-files |
|
17 |
+ uses: tj-actions/changed-files@v42 |
|
18 |
+ |
|
19 |
+ - name: Get extra arguments for PHP-CS-Fixer |
|
20 |
+ id: phpcs-intersection |
|
21 |
+ run: | |
|
22 |
+ CHANGED_FILES=$(echo "${{ steps.changed-files.outputs.all_changed_and_modified_files }}" | tr ' ' '\n') |
|
23 |
+ if ! echo "${CHANGED_FILES}" | grep -qE "^(\\.php-cs-fixer(\\.dist)?\\.php|composer\\.lock)$"; then EXTRA_ARGS=$(printf -- '--path-mode=intersection\n--\n%s' "${CHANGED_FILES}"); else EXTRA_ARGS=''; fi |
|
24 |
+ echo "PHPCS_EXTRA_ARGS<<EOF" >> $GITHUB_ENV |
|
25 |
+ echo "$EXTRA_ARGS" >> $GITHUB_ENV |
|
26 |
+ echo "EOF" >> $GITHUB_ENV |
|
27 |
+ |
|
28 |
+ - name: PHP-CS-Fixer |
|
29 |
+ uses: docker://oskarstark/php-cs-fixer-ga |
|
30 |
+ with: |
|
31 |
+ args: --config=.php-cs-fixer.dist.php -v --dry-run --stop-on-violation --using-cache=no ${{ env.PHPCS_EXTRA_ARGS }}" |
|
0 | 32 |
\ No newline at end of file |
... | ... |
@@ -0,0 +1,178 @@ |
1 |
+<?php |
|
2 |
+ |
|
3 |
+/** |
|
4 |
+ * Simple Machines Forum (SMF) |
|
5 |
+ * |
|
6 |
+ * @package SMF |
|
7 |
+ * @author Simple Machines https://www.simplemachines.org |
|
8 |
+ * @copyright 2024 Simple Machines and individual contributors |
|
9 |
+ * @license https://www.simplemachines.org/about/smf/license.php BSD |
|
10 |
+ * |
|
11 |
+ * @version 3.0 Alpha 1 |
|
12 |
+ */ |
|
13 |
+ |
|
14 |
+$finder = (new PhpCsFixer\Finder()) |
|
15 |
+ ->in(__DIR__) |
|
16 |
+ // Skip anything being ignored in .gitignore. |
|
17 |
+ ->ignoreVCSIgnored(true); |
|
18 |
+ |
|
19 |
+return (new PhpCsFixer\Config()) |
|
20 |
+ ->setRules([ |
|
21 |
+ '@PSR12' => true, |
|
22 |
+ |
|
23 |
+ // PSR12 overrides. |
|
24 |
+ 'no_closing_tag' => false, |
|
25 |
+ 'no_break_comment' => false, // A bit buggy with comments. |
|
26 |
+ 'statement_indentation' => false, // A bit buggy with comments. |
|
27 |
+ |
|
28 |
+ // Array notation. |
|
29 |
+ 'array_syntax' => ['syntax' => 'short'], |
|
30 |
+ 'normalize_index_brace' => true, |
|
31 |
+ 'whitespace_after_comma_in_array' => true, |
|
32 |
+ |
|
33 |
+ // Basic. |
|
34 |
+ 'no_trailing_comma_in_singleline' => true, |
|
35 |
+ |
|
36 |
+ // Casing. |
|
37 |
+ 'class_reference_name_casing' => true, |
|
38 |
+ |
|
39 |
+ // Cast notation. |
|
40 |
+ 'cast_spaces' => ['space' => 'single'], |
|
41 |
+ |
|
42 |
+ // Control structure. |
|
43 |
+ 'include' => true, |
|
44 |
+ 'no_superfluous_elseif' => true, |
|
45 |
+ 'no_useless_else' => true, |
|
46 |
+ 'simplified_if_return' => true, |
|
47 |
+ 'trailing_comma_in_multiline' => [ |
|
48 |
+ 'after_heredoc' => true, |
|
49 |
+ 'elements' => [ |
|
50 |
+ 'arguments', |
|
51 |
+ 'arrays', |
|
52 |
+ 'match', |
|
53 |
+ 'parameters', |
|
54 |
+ ], |
|
55 |
+ ], |
|
56 |
+ |
|
57 |
+ // Function notation. |
|
58 |
+ 'lambda_not_used_import' => true, |
|
59 |
+ 'nullable_type_declaration_for_default_null_value' => true, |
|
60 |
+ |
|
61 |
+ // Import. |
|
62 |
+ 'no_unused_imports' => true, |
|
63 |
+ 'ordered_imports' => [ |
|
64 |
+ 'imports_order' => [ |
|
65 |
+ 'class', |
|
66 |
+ 'function', |
|
67 |
+ 'const', |
|
68 |
+ ], |
|
69 |
+ 'sort_algorithm' => 'alpha', |
|
70 |
+ ], |
|
71 |
+ |
|
72 |
+ // Language construct. |
|
73 |
+ 'combine_consecutive_issets' => true, |
|
74 |
+ 'combine_consecutive_unsets' => true, |
|
75 |
+ 'nullable_type_declaration' => ['syntax' => 'question_mark'], |
|
76 |
+ |
|
77 |
+ // Namespace notation. |
|
78 |
+ 'no_leading_namespace_whitespace' => true, |
|
79 |
+ |
|
80 |
+ // Operator. |
|
81 |
+ 'concat_space' => ['spacing' => 'one'], |
|
82 |
+ 'operator_linebreak' => [ |
|
83 |
+ 'only_booleans' => true, |
|
84 |
+ 'position' => 'beginning', |
|
85 |
+ ], |
|
86 |
+ 'standardize_not_equals' => true, |
|
87 |
+ 'ternary_to_null_coalescing' => true, |
|
88 |
+ |
|
89 |
+ // PHPDoc. |
|
90 |
+ 'phpdoc_indent' => true, |
|
91 |
+ 'phpdoc_line_span' => [ |
|
92 |
+ 'const' => 'multi', |
|
93 |
+ 'property' => 'multi', |
|
94 |
+ 'method' => 'multi', |
|
95 |
+ ], |
|
96 |
+ 'phpdoc_no_access' => true, |
|
97 |
+ 'phpdoc_no_useless_inheritdoc' => true, |
|
98 |
+ 'phpdoc_order' => [ |
|
99 |
+ 'order' => [ |
|
100 |
+ 'param', |
|
101 |
+ 'throws', |
|
102 |
+ 'return', |
|
103 |
+ ], |
|
104 |
+ ], |
|
105 |
+ 'phpdoc_no_empty_return' => true, |
|
106 |
+ 'phpdoc_param_order' => true, |
|
107 |
+ 'phpdoc_scalar' => [ |
|
108 |
+ 'types' => [ |
|
109 |
+ 'boolean', |
|
110 |
+ 'callback', |
|
111 |
+ 'double', |
|
112 |
+ 'integer', |
|
113 |
+ 'real', |
|
114 |
+ 'str', |
|
115 |
+ ], |
|
116 |
+ ], |
|
117 |
+ 'phpdoc_to_comment' => [ |
|
118 |
+ 'ignored_tags' => ['todo'], |
|
119 |
+ ], |
|
120 |
+ 'phpdoc_trim_consecutive_blank_line_separation' => true, |
|
121 |
+ 'phpdoc_types' => [ |
|
122 |
+ 'groups' => ['alias', 'meta', 'simple'], |
|
123 |
+ ], |
|
124 |
+ 'phpdoc_var_without_name' => true, |
|
125 |
+ |
|
126 |
+ // Return notation. |
|
127 |
+ 'no_useless_return' => true, |
|
128 |
+ 'simplified_null_return' => true, |
|
129 |
+ |
|
130 |
+ // Semicolon. |
|
131 |
+ 'multiline_whitespace_before_semicolons' => true, |
|
132 |
+ 'no_empty_statement' => true, |
|
133 |
+ 'no_singleline_whitespace_before_semicolons' => true, |
|
134 |
+ |
|
135 |
+ // String notation. |
|
136 |
+ 'explicit_string_variable' => true, |
|
137 |
+ 'simple_to_complex_string_variable' => true, |
|
138 |
+ 'single_quote' => true, |
|
139 |
+ |
|
140 |
+ // Whitespace. |
|
141 |
+ 'array_indentation' => true, |
|
142 |
+ 'blank_line_before_statement' => [ |
|
143 |
+ 'statements' => [ |
|
144 |
+ 'case', |
|
145 |
+ 'declare', |
|
146 |
+ 'default', |
|
147 |
+ 'do', |
|
148 |
+ 'exit', |
|
149 |
+ 'for', |
|
150 |
+ 'foreach', |
|
151 |
+ 'goto', |
|
152 |
+ 'if', |
|
153 |
+ 'include', |
|
154 |
+ 'include_once', |
|
155 |
+ 'require', |
|
156 |
+ 'require_once', |
|
157 |
+ 'return', |
|
158 |
+ 'switch', |
|
159 |
+ 'throw', |
|
160 |
+ 'try', |
|
161 |
+ 'while', |
|
162 |
+ 'yield', |
|
163 |
+ 'yield_from', |
|
164 |
+ ], |
|
165 |
+ ], |
|
166 |
+ 'heredoc_indentation' => ['indentation' => 'start_plus_one'], |
|
167 |
+ 'method_chaining_indentation' => true, |
|
168 |
+ 'no_spaces_around_offset' => [ |
|
169 |
+ 'positions' => ['inside', 'outside'], |
|
170 |
+ ], |
|
171 |
+ 'type_declaration_spaces' => [ |
|
172 |
+ 'elements' => ['function', 'property'], |
|
173 |
+ ], |
|
174 |
+ ]) |
|
175 |
+ ->setIndent("\t") |
|
176 |
+ ->setFinder($finder); |
|
177 |
+ |
|
178 |
+?> |
|
0 | 179 |
\ No newline at end of file |
... | ... |
@@ -28,7 +28,7 @@ class SFS |
28 | 28 |
private array $blockTypeMap = [ |
29 | 29 |
'username' => 1, |
30 | 30 |
'email' => 2, |
31 |
- 'ip' => 3 |
|
31 |
+ 'ip' => 3, |
|
32 | 32 |
]; |
33 | 33 |
|
34 | 34 |
/** |
... | ... |
@@ -45,7 +45,7 @@ class SFS |
45 | 45 |
'sfs_emailcheck' => 1, |
46 | 46 |
'sfs_username_confidence' => 50.01, |
47 | 47 |
'sfs_region' => 0, |
48 |
- 'sfs_verfOptMemPostThreshold' => 5 |
|
48 |
+ 'sfs_verfOptMemPostThreshold' => 5, |
|
49 | 49 |
]; |
50 | 50 |
|
51 | 51 |
/* |
... | ... |
@@ -69,20 +69,20 @@ class SFS |
69 | 69 |
* @since 1.0 |
70 | 70 |
* @uses integrate_pre_load - Hook SMF2.0 |
71 | 71 |
* @uses integrate_pre_load - Hook SMF2.1 |
72 |
- * @return void No return is generated |
|
73 | 72 |
*/ |
74 | 73 |
public static function hook_pre_load(): void |
75 | 74 |
{ |
76 | 75 |
$GLOBALS['smcFunc']['classSFS'] = self::selfClass(); |
77 | 76 |
|
78 | 77 |
// SMF 2.0 needs some help. |
79 |
- if ($GLOBALS['smcFunc']['classSFS']->versionCheck('2.0')) |
|
78 |
+ if ($GLOBALS['smcFunc']['classSFS']->versionCheck('2.0')) { |
|
80 | 79 |
$GLOBALS['smcFunc']['classSFS']->loadSources([ |
81 | 80 |
'SFS-Admin', |
82 | 81 |
'SFS-Logs', |
83 |
- 'SFS-Profile' |
|
82 |
+ 'SFS-Profile', |
|
84 | 83 |
]); |
85 | 84 |
} |
85 |
+ } |
|
86 | 86 |
|
87 | 87 |
/** |
88 | 88 |
* Creates a self reference to the SFS Log class for use later. |
... | ... |
@@ -93,8 +93,9 @@ class SFS |
93 | 93 |
*/ |
94 | 94 |
public static function selfClass(): self |
95 | 95 |
{ |
96 |
- if (!isset($GLOBALS['context']['instances'][__CLASS__])) |
|
96 |
+ if (!isset($GLOBALS['context']['instances'][__CLASS__])) { |
|
97 | 97 |
$GLOBALS['context']['instances'][__CLASS__] = new self(); |
98 |
+ } |
|
98 | 99 |
|
99 | 100 |
return $GLOBALS['context']['instances'][__CLASS__]; |
100 | 101 |
} |
... | ... |
@@ -106,16 +107,17 @@ class SFS |
106 | 107 |
* @CalledIn SMF 2.0, SMF 2.1 |
107 | 108 |
* @version 1.5.0 |
108 | 109 |
* @since 1.0 |
109 |
- * @return void No return is generated |
|
110 | 110 |
*/ |
111 | 111 |
public function __construct() |
112 | 112 |
{ |
113 | 113 |
// Is this SMF 2.0? |
114 |
- if (!function_exists('loadCacheAccelerator')) |
|
114 |
+ if (!function_exists('loadCacheAccelerator')) { |
|
115 | 115 |
$this->softwareVersion = '2.0'; |
116 |
+ } |
|
116 | 117 |
|
117 |
- foreach (['scripturl', 'context', 'smcFunc', 'txt', 'modSettings', 'user_info'] as $f) |
|
118 |
+ foreach (['scripturl', 'context', 'smcFunc', 'txt', 'modSettings', 'user_info'] as $f) { |
|
118 | 119 |
$this->{$f} = &$GLOBALS[$f]; |
120 |
+ } |
|
119 | 121 |
|
120 | 122 |
// Setup the defaults. |
121 | 123 |
$this->loadDefaults(); |
... | ... |
@@ -162,8 +165,9 @@ class SFS |
162 | 165 |
private function checkRegisterRequest(array &$regOptions, array &$theme_vars): bool |
163 | 166 |
{ |
164 | 167 |
// Admins are not spammers.. usually. |
165 |
- if ($regOptions['interface'] == 'admin') |
|
168 |
+ if ($regOptions['interface'] == 'admin') { |
|
166 | 169 |
return true; |
170 |
+ } |
|
167 | 171 |
|
168 | 172 |
// Pass everything and let us handle what options we pass on. We pass the register_vars as these are what we have cleaned up. |
169 | 173 |
return $this->sfsCheck([ |
... | ... |
@@ -212,8 +217,9 @@ class SFS |
212 | 217 |
public function checkVerificationTest(array $thisVerification, array &$verification_errors): bool |
213 | 218 |
{ |
214 | 219 |
// Registration is skipped as we process that differently. |
215 |
- if ($thisVerification['id'] == 'register') |
|
220 |
+ if ($thisVerification['id'] == 'register') { |
|
216 | 221 |
return true; |
222 |
+ } |
|
217 | 223 |
|
218 | 224 |
// Get our options data. |
219 | 225 |
$options = $this->getVerificationOptions(); |
... | ... |
@@ -225,11 +231,11 @@ class SFS |
225 | 231 |
'search' => $this->user_info['is_guest'] || empty($this->user_info['posts']) || $this->user_info['posts'] < $this->modSettings['sfs_verfOptMemPostThreshold'], |
226 | 232 |
]; |
227 | 233 |
|
228 |
- foreach (array_filter($verificationMap, function($extendedChecks, $key) use ($thisVerification, $options) |
|
229 |
- { |
|
234 |
+ foreach (array_filter($verificationMap, function ($extendedChecks, $key) use ($thisVerification, $options) { |
|
230 | 235 |
return $thisVerification['id'] == $key && in_array($key, $options); |
231 |
- }, ARRAY_FILTER_USE_BOTH) as $key => $extendedChecks) |
|
232 |
- return call_user_func(array($this, 'checkVerificationTest' . ucfirst($key))); |
|
236 |
+ }, ARRAY_FILTER_USE_BOTH) as $key => $extendedChecks) { |
|
237 |
+ return call_user_func([$this, 'checkVerificationTest' . ucfirst($key)]); |
|
238 |
+ } |
|
233 | 239 |
|
234 | 240 |
// Others areas. We have to play a guessing game here. |
235 | 241 |
return $this->checkVerificationTestExtra($thisVerification); |
... | ... |
@@ -247,16 +253,18 @@ class SFS |
247 | 253 |
private function checkVerificationTestPost(): bool |
248 | 254 |
{ |
249 | 255 |
// Guests! |
250 |
- if ($this->user_info['is_guest']) |
|
251 |
- { |
|
252 |
- $guestname = !isset($_POST['guestname']) ? '' : trim(normalize_spaces(sanitize_chars($_POST['guestname'], 1, ' '), true, true, array('no_breaks' => true, 'replace_tabs' => true, 'collapse_hspace' => true))); |
|
256 |
+ if ($this->user_info['is_guest']) { |
|
257 |
+ $guestname = !isset($_POST['guestname']) ? '' : trim(normalize_spaces(sanitize_chars($_POST['guestname'], 1, ' '), true, true, ['no_breaks' => true, 'replace_tabs' => true, 'collapse_hspace' => true])); |
|
253 | 258 |
$email = !isset($_POST['email']) ? '' : trim($_POST['email']); |
254 | 259 |
|
255 | 260 |
// SMF will take care of these if we are checking them. |
256 |
- if (!empty($this->modSettings['sfs_emailcheck']) && empty($modSettings['guest_post_no_email']) && empty($email)) |
|
261 |
+ if (!empty($this->modSettings['sfs_emailcheck']) && empty($modSettings['guest_post_no_email']) && empty($email)) { |
|
257 | 262 |
return false; |
258 |
- else if (!empty($this->modSettings['sfs_usernamecheck']) && empty($guestname)) |
|
263 |
+ } |
|
264 |
+ |
|
265 |
+ if (!empty($this->modSettings['sfs_usernamecheck']) && empty($guestname)) { |
|
259 | 266 |
return false; |
267 |
+ } |
|
260 | 268 |
|
261 | 269 |
return $this->sfsCheck([ |
262 | 270 |
['username' => $guestname], |
... | ... |
@@ -266,15 +274,17 @@ class SFS |
266 | 274 |
], 'post'); |
267 | 275 |
|
268 | 276 |
} |
277 |
+ |
|
269 | 278 |
// Members and they don't have enough posts? |
270 |
- elseif (empty($this->user_info['posts']) || $this->user_info['posts'] < $this->modSettings['sfs_verfOptMemPostThreshold']) |
|
279 |
+ if (empty($this->user_info['posts']) || $this->user_info['posts'] < $this->modSettings['sfs_verfOptMemPostThreshold']) { |
|
271 | 280 |
return $this->sfsCheck([ |
272 | 281 |
['username' => $this->user_info['username']], |
273 | 282 |
['email' => $this->user_info['email']], |
274 | 283 |
['ip' => $this->user_info['ip']], |
275 | 284 |
['ip' => $this->user_info['ip2']], |
276 | 285 |
], 'post'); |
277 |
- else |
|
286 |
+ } |
|
287 |
+ |
|
278 | 288 |
return true; |
279 | 289 |
} |
280 | 290 |
|
... | ... |
@@ -326,8 +336,7 @@ class SFS |
326 | 336 |
*/ |
327 | 337 |
private function checkVerificationTestExtra(array $thisVerification): bool |
328 | 338 |
{ |
329 |
- foreach (array_filter($this->extraVerificationOptions, function($option) use ($thisVerification) {return $thisVerification['id'] == $option; }) as $option) |
|
330 |
- { |
|
339 |
+ foreach (array_filter($this->extraVerificationOptions, function ($option) use ($thisVerification) {return $thisVerification['id'] == $option; }) as $option) { |
|
331 | 340 |
// Always try to send off IPs. |
332 | 341 |
$checks = [ |
333 | 342 |
['ip' => $this->user_info['ip']], |
... | ... |
@@ -362,34 +371,37 @@ class SFS |
362 | 371 |
* @since 1.0 |
363 | 372 |
* @return bool True is success, no other bool is expeicifcly defined yet. |
364 | 373 |
*/ |
365 |
- private function sfsCheck(array $checks, string $area = null): bool |
|
374 |
+ private function sfsCheck(array $checks, ?string $area = null): bool |
|
366 | 375 |
{ |
367 | 376 |
// Send it off. |
368 | 377 |
$response = $this->SendSFS($checks, $area); |
369 | 378 |
|
370 | 379 |
// No checks found? Can't do this. |
371 |
- if ($response === []) |
|
372 |
- { |
|
380 |
+ if ($response === []) { |
|
373 | 381 |
$this->logAllStats('error', $checks, 'error'); |
374 | 382 |
log_error($this->txt('sfs_request_failure_nodata') . ':' . $this->buildServerURL(), 'critical'); |
383 |
+ |
|
375 | 384 |
return true; |
376 | 385 |
} |
377 | 386 |
|
378 | 387 |
$requestBlocked = ''; |
379 | 388 |
|
380 | 389 |
// Are we requiring multiple checks. |
381 |
- if (!empty($this->modSettings['sfs_required']) && $this->modSettings['sfs_required'] != 'any') |
|
390 |
+ if (!empty($this->modSettings['sfs_required']) && $this->modSettings['sfs_required'] != 'any') { |
|
382 | 391 |
$requestBlocked = $this->sfsCheckMultiple($response, $area); |
392 |
+ } |
|
383 | 393 |
// Otherwise we will check anything enabled and if any match, its found |
384 |
- else |
|
394 |
+ else { |
|
385 | 395 |
$requestBlocked = $this->sfsCheckSingle($response, $area); |
396 |
+ } |
|
386 | 397 |
|
387 | 398 |
// Log all the stats? Debug mode here. |
388 | 399 |
$this->logAllStats('all', $checks, $requestBlocked); |
389 | 400 |
|
390 | 401 |
// At this point, we have checked everything, do what needs to be done for our good person. |
391 |
- if (empty($requestBlocked)) |
|
402 |
+ if (empty($requestBlocked)) { |
|
392 | 403 |
return true; |
404 |
+ } |
|
393 | 405 |
|
394 | 406 |
// You are a bad spammer, but don't tell them what was blocked. |
395 | 407 |
fatal_error($this->txt('sfs_request_blocked'), false); |
... | ... |
@@ -406,7 +418,7 @@ class SFS |
406 | 418 |
* @since 1.4.0 |
407 | 419 |
* @return array The results of the check. |
408 | 420 |
*/ |
409 |
- public function SendSFS(array $checks, string $area = null): array |
|
421 |
+ public function SendSFS(array $checks, ?string $area = null): array |
|
410 | 422 |
{ |
411 | 423 |
$requestURL = $this->buildServerURL(); |
412 | 424 |
|
... | ... |
@@ -414,8 +426,9 @@ class SFS |
414 | 426 |
$singleCheckFound = $this->buildCheckPath($requestURL, $checks, $area); |
415 | 427 |
|
416 | 428 |
// No checks found? Can't do this. |
417 |
- if (empty($singleCheckFound)) |
|
429 |
+ if (empty($singleCheckFound)) { |
|
418 | 430 |
return []; |
431 |
+ } |
|
419 | 432 |
|
420 | 433 |
// Send this off. |
421 | 434 |
return $this->sendSFSCheck($requestURL, $checks, $area); |
... | ... |
@@ -433,22 +446,24 @@ class SFS |
433 | 446 |
* @since 1.5.0 |
434 | 447 |
* @return string The requests that matched as blocked. |
435 | 448 |
*/ |
436 |
- private function sfsCheckMultiple(array $response, string $area = null): string |
|
449 |
+ private function sfsCheckMultiple(array $response, ?string $area = null): string |
|
437 | 450 |
{ |
438 | 451 |
// When requiring multiple checks, we require all to match. |
439 | 452 |
$requiredChecks = explode('|', $this->modSettings['sfs_required']); |
440 | 453 |
$requestBlocked = ''; |
441 | 454 |
$result = true; |
442 |
- foreach ($requiredChecks as $key) |
|
443 |
- { |
|
444 |
- $test = call_user_func(array($this, 'sfsCheck_' . $key), $response[$key], $area); |
|
455 |
+ |
|
456 |
+ foreach ($requiredChecks as $key) { |
|
457 |
+ $test = call_user_func([$this, 'sfsCheck_' . $key], $response[$key], $area); |
|
445 | 458 |
$requestBlocked .= !empty($test) ? $test . '|' : ''; |
446 | 459 |
$result &= !empty($test); |
447 | 460 |
} |
448 | 461 |
|
449 | 462 |
// Not all checks passed, so we will allow it. |
450 |
- if (!$result) |
|
463 |
+ if (!$result) { |
|
451 | 464 |
return ''; |
465 |
+ } |
|
466 |
+ |
|
452 | 467 |
return $requestBlocked; |
453 | 468 |
} |
454 | 469 |
|
... | ... |
@@ -464,18 +479,21 @@ class SFS |
464 | 479 |
* @since 1.5.0 |
465 | 480 |
* @return string The request that matched as blocked. |
466 | 481 |
*/ |
467 |
- private function sfsCheckSingle(array $response, string $area = null): string |
|
482 |
+ private function sfsCheckSingle(array $response, ?string $area = null): string |
|
468 | 483 |
{ |
469 | 484 |
$checkMap = [ |
470 | 485 |
'ip' => !empty($this->modSettings['sfs_ipcheck']) && !empty($response['ip']), |
471 | 486 |
'username' => !empty($this->modSettings['sfs_usernamecheck']) && !empty($response['username']), |
472 |
- 'email' => !empty($this->modSettings['sfs_emailcheck']) && !empty($response['email']) |
|
487 |
+ 'email' => !empty($this->modSettings['sfs_emailcheck']) && !empty($response['email']), |
|
473 | 488 |
]; |
474 | 489 |
|
475 | 490 |
$requestBlocked = ''; |
476 |
- foreach ($checkMap as $key => $checkEnabled) |
|
477 |
- if (empty($requestBlocked) && $checkEnabled) |
|
478 |
- $requestBlocked = call_user_func(array($this, 'sfsCheck_' . $key), $response[$key], $area); |
|
491 |
+ |
|
492 |
+ foreach ($checkMap as $key => $checkEnabled) { |
|
493 |
+ if (empty($requestBlocked) && $checkEnabled) { |
|
494 |
+ $requestBlocked = call_user_func([$this, 'sfsCheck_' . $key], $response[$key], $area); |
|
495 |
+ } |
|
496 |
+ } |
|
479 | 497 |
|
480 | 498 |
return $requestBlocked; |
481 | 499 |
} |
... | ... |
@@ -493,28 +511,30 @@ class SFS |
493 | 511 |
* @since 1.1 |
494 | 512 |
* @return array data we received back, could be a empty array. |
495 | 513 |
*/ |
496 |
- private function sendSFSCheck(string $requestURL, array $checks, string $area = null): array |
|
514 |
+ private function sendSFSCheck(string $requestURL, array $checks, ?string $area = null): array |
|
497 | 515 |
{ |
498 | 516 |
// SMF 2.0 has the fetch_web_data in the Subs-Packages, 2.1 it is in Subs.php. |
499 |
- if ($this->versionCheck('2.0', 'smf')) |
|
517 |
+ if ($this->versionCheck('2.0', 'smf')) { |
|
500 | 518 |
$this->loadSources('Subs-Package'); |
519 |
+ } |
|
501 | 520 |
|
502 | 521 |
// Now we have a URL, lets go get it. |
503 | 522 |
$result = fetch_web_data($requestURL); |
504 |
- if ($result === false) |
|
505 |
- { |
|
523 |
+ |
|
524 |
+ if ($result === false) { |
|
506 | 525 |
$this->logAllStats('error', $checks, 'failure'); |
507 | 526 |
log_error($this->txt('sfs_request_failure') . ':' . $requestURL, 'critical'); |
527 |
+ |
|
508 | 528 |
return true; |
509 | 529 |
} |
510 | 530 |
|
511 | 531 |
$response = $this->decodeJSON($result); |
512 | 532 |
|
513 | 533 |
// No data received, log it and let them through. |
514 |
- if (empty($response)) |
|
515 |
- { |
|
534 |
+ if (empty($response)) { |
|
516 | 535 |
$this->logAllStats('error', $checks, 'failure'); |
517 | 536 |
log_error($this->txt('sfs_request_failure') . ':' . $requestURL, 'critical'); |
537 |
+ |
|
518 | 538 |
return true; |
519 | 539 |
} |
520 | 540 |
|
... | ... |
@@ -537,12 +557,14 @@ class SFS |
537 | 557 |
$this->loadSources(['SFS-Bans']); |
538 | 558 |
|
539 | 559 |
$requestBlocked = ''; |
540 |
- foreach (array_filter($ips, function ($check) {return !empty($check['appears']); }) as $check) |
|
541 |
- { |
|
560 |
+ |
|
561 |
+ foreach (array_filter($ips, function ($check) {return !empty($check['appears']); }) as $check) { |
|
542 | 562 |
// Ban them because they are black listed? |
543 | 563 |
$autoBlackListResult = '0'; |
544 |
- if (!empty($this->modSettings['sfs_ipcheck_autoban']) && !empty($check['frequency']) && $check['frequency'] == 255) |
|
564 |
+ |
|
565 |
+ if (!empty($this->modSettings['sfs_ipcheck_autoban']) && !empty($check['frequency']) && $check['frequency'] == 255) { |
|
545 | 566 |
$autoBlackListResult = SFSB::AddNewIpBan($check['value']); |
567 |
+ } |
|
546 | 568 |
|
547 | 569 |
$this->logBlockedStats('ip', $check); |
548 | 570 |
$requestBlocked = 'ip,' . $this->smcFunc['htmlspecialchars']($check['value']) . ',' . ($autoBlackListResult ? 1 : 0); |
... | ... |
@@ -566,21 +588,19 @@ class SFS |
566 | 588 |
private function sfsCheck_username(array $usernames, string $area = ''): string |
567 | 589 |
{ |
568 | 590 |
$requestBlocked = ''; |
569 |
- foreach (array_filter($usernames, function ($check) {return !empty($check['appears']); }) as $check) |
|
570 |
- { |
|
591 |
+ |
|
592 |
+ foreach (array_filter($usernames, function ($check) {return !empty($check['appears']); }) as $check) { |
|
571 | 593 |
// Combine with $area we could also require admin approval above thresholds on things like register. |
572 | 594 |
$shouldBlock = true; |
573 | 595 |
|
574 | 596 |
// We are not confident that they should be blocked. |
575 |
- if (!empty($this->modSettings['sfs_username_confidence']) && !empty($check['confidence']) && $area == 'register' && (float) $this->modSettings['sfs_username_confidence'] > (float) $check['confidence']) |
|
576 |
- { |
|
597 |
+ if (!empty($this->modSettings['sfs_username_confidence']) && !empty($check['confidence']) && $area == 'register' && (float) $this->modSettings['sfs_username_confidence'] > (float) $check['confidence']) { |
|
577 | 598 |
$this->logAllStats('all', $check, 'username,' . $this->smcFunc['htmlspecialchars']($check['value']) . ',' . $check['confidence']); |
578 | 599 |
$shouldBlock = false; |
579 | 600 |
} |
580 | 601 |
|
581 | 602 |
// Block them. |
582 |
- if ($shouldBlock) |
|
583 |
- { |
|
603 |
+ if ($shouldBlock) { |
|
584 | 604 |
$this->logBlockedStats('username', $check); |
585 | 605 |
$requestBlocked = 'username,' . $this->smcFunc['htmlspecialchars']($check['value']) . ',' . $check['confidence']; |
586 | 606 |
break; |
... | ... |
@@ -604,8 +624,8 @@ class SFS |
604 | 624 |
private function sfsCheck_email(array $email, string $area = ''): string |
605 | 625 |
{ |
606 | 626 |
$requestBlocked = ''; |
607 |
- foreach (array_filter($email, function ($check) {return !empty($check['appears']); }) as $check) |
|
608 |
- { |
|
627 |
+ |
|
628 |
+ foreach (array_filter($email, function ($check) {return !empty($check['appears']); }) as $check) { |
|
609 | 629 |
$this->logBlockedStats('email', $check); |
610 | 630 |
$requestBlocked = 'email,' . $this->smcFunc['htmlspecialchars']($check['value']); |
611 | 631 |
break; |
... | ... |
@@ -627,24 +647,24 @@ class SFS |
627 | 647 |
* @since 1.0 |
628 | 648 |
* @return bool True we found something to check, false nothing.. $requestURL will be updated with the new data. |
629 | 649 |
*/ |
630 |
- private function buildCheckPath(string &$requestURL, array $checks, string $area = null): bool |
|
650 |
+ private function buildCheckPath(string &$requestURL, array $checks, ?string $area = null): bool |
|
631 | 651 |
{ |
632 | 652 |
$singleCheckFound = false; |
633 |
- foreach ($checks as $chk) |
|
634 |
- { |
|
653 |
+ |
|
654 |
+ foreach ($checks as $chk) { |
|
635 | 655 |
// Hold up, we are not processing this check. |
636 | 656 |
$chk = array_filter($chk, function ($value, $type) {return !(in_array($type, ['email', 'username', 'ip']) && empty($this->modSettings['sfs_' . $type . 'check'])); }, ARRAY_FILTER_USE_BOTH); |
637 | 657 |
|
638 | 658 |
// No value? Can't do this. |
639 | 659 |
$chk = array_filter($chk, function ($value) {return !empty($value); }); |
640 | 660 |
|
641 |
- foreach ($chk as $type => $value) |
|
642 |
- { |
|
661 |
+ foreach ($chk as $type => $value) { |
|
643 | 662 |
// Emails and usernames must be UTF-8, Only a issue with SMF 2.0. |
644 |
- if (!$this->context['utf8'] && ($type == 'email' || $type == 'username')) |
|
663 |
+ if (!$this->context['utf8'] && ($type == 'email' || $type == 'username')) { |
|
645 | 664 |
$requestURL .= '&' . $type . '[]=' . iconv($this->context['character_set'], 'UTF-8//IGNORE', $value); |
646 |
- else |
|
665 |
+ } else { |
|
647 | 666 |
$requestURL .= '&' . $type . '[]=' . urlencode($value); |
667 |
+ } |
|
648 | 668 |
|
649 | 669 |
$singleCheckFound = true; |
650 | 670 |
} |
... | ... |
@@ -667,7 +687,8 @@ class SFS |
667 | 687 |
*/ |
668 | 688 |
private function logBlockedStats(string $type, array $check): void |
669 | 689 |
{ |
670 |
- $this->smcFunc['db_insert']('', |
|
690 |
+ $this->smcFunc['db_insert']( |
|
691 |
+ '', |
|
671 | 692 |
'{db_prefix}log_sfs', |
672 | 693 |
[ |
673 | 694 |
'id_type' => 'int', |
... | ... |
@@ -679,10 +700,10 @@ class SFS |
679 | 700 |
'ip' => 'string', |
680 | 701 |
'ip2' => 'string', |
681 | 702 |
'checks' => 'string', |
682 |
- 'result' => 'string' |
|
703 |
+ 'result' => 'string', |
|
683 | 704 |
], |
684 | 705 |
[ |
685 |
- isset($this->blockTypeMap[$type]) ? $this->blockTypeMap[$type] : 99, // Blocked request |
|
706 |
+ $this->blockTypeMap[$type] ?? 99, // Blocked request |
|
686 | 707 |
time(), |
687 | 708 |
$this->smcFunc['htmlspecialchars']($_SERVER['REQUEST_URL']), |
688 | 709 |
$this->user_info['id'], |
... | ... |
@@ -691,9 +712,9 @@ class SFS |
691 | 712 |
$type == 'ip' ? $check['value'] : $this->user_info['ip'], |
692 | 713 |
$this->user_info['ip2'], |
693 | 714 |
$this->encodeJSON($check), |
694 |
- 'Blocked' |
|
715 |
+ 'Blocked', |
|
695 | 716 |
], |
696 |
- ['id_sfs', 'id_type'] |
|
717 |
+ ['id_sfs', 'id_type'], |
|
697 | 718 |
); |
698 | 719 |
} |
699 | 720 |
|
... | ... |
@@ -701,8 +722,8 @@ class SFS |
701 | 722 |
* Debug logging that this was blocked.. |
702 | 723 |
* |
703 | 724 |
* @param string $type Either error or all, currently ignored. |
704 |
- * @param array $check The check data we are logging. |
|
705 | 725 |
* @param string $DebugMessage Debugging message, sometimes just is error or failure, otherwise a comma separated of what request was blocked. |
726 |
+ * @param array $check The check data we are logging. |
|
706 | 727 |
* |
707 | 728 |
* @internal |
708 | 729 |
* @CalledIn SMF 2.0, SMF 2.1 |
... | ... |
@@ -712,10 +733,12 @@ class SFS |
712 | 733 |
*/ |
713 | 734 |
private function logAllStats(string $type, array $checks, string $DebugMessage): void |
714 | 735 |
{ |
715 |
- if ($type == 'all' && empty($this->modSettings['sfs_log_debug'])) |
|
736 |
+ if ($type == 'all' && empty($this->modSettings['sfs_log_debug'])) { |
|
716 | 737 |
return; |
738 |
+ } |
|
717 | 739 |
|
718 |
- $this->smcFunc['db_insert']('', |
|
740 |
+ $this->smcFunc['db_insert']( |
|
741 |
+ '', |
|
719 | 742 |
'{db_prefix}log_sfs', |
720 | 743 |
[ |
721 | 744 |
'id_type' => 'int', |
... | ... |
@@ -727,7 +750,7 @@ class SFS |
727 | 750 |
'ip' => 'string', |
728 | 751 |
'ip2' => 'string', |
729 | 752 |
'checks' => 'string', |
730 |
- 'result' => 'string' |
|
753 |
+ 'result' => 'string', |
|
731 | 754 |
], |
732 | 755 |
[ |
733 | 756 |
0, // Debug type. |
... | ... |
@@ -741,7 +764,7 @@ class SFS |
741 | 764 |
json_encode($checks), |
742 | 765 |
$DebugMessage, |
743 | 766 |
], |
744 |
- ['id_sfs', 'id_type'] |
|
767 |
+ ['id_sfs', 'id_type'], |
|
745 | 768 |
); |
746 | 769 |
} |
747 | 770 |
|
... | ... |
@@ -761,18 +784,21 @@ class SFS |
761 | 784 |
public function decodeJSON(string $requestData): array |
762 | 785 |
{ |
763 | 786 |
// Do we have $smcFunc? It handles errors and logs them as needed. |
764 |
- if (isset($this->smcFunc['json_decode']) && is_callable($this->smcFunc['json_decode'])) |
|
787 |
+ if (isset($this->smcFunc['json_decode']) && is_callable($this->smcFunc['json_decode'])) { |
|
765 | 788 |
return $this->smcFunc['json_decode']($requestData, true); |
789 |
+ } |
|
766 | 790 |
// Back to the basics. |
767 |
- else |
|
768 |
- { |
|
791 |
+ |
|
792 |
+ |
|
769 | 793 |
$data = @json_decode($requestData, true); |
770 | 794 |
|
771 | 795 |
// We got a error, return nothing. Don't log this, not worth it. |
772 |
- if (json_last_error() !== JSON_ERROR_NONE) |
|
796 |
+ if (json_last_error() !== JSON_ERROR_NONE) { |
|
773 | 797 |
return []; |
774 |
- return $data; |
|
775 | 798 |
} |
799 |
+ |
|
800 |
+ return $data; |
|
801 |
+ |
|
776 | 802 |
} |
777 | 803 |
|
778 | 804 |
/** |
... | ... |
@@ -791,18 +817,21 @@ class SFS |
791 | 817 |
public function encodeJSON(array $requestData): string |
792 | 818 |
{ |
793 | 819 |
// Do we have $smcFunc? It handles errors and logs them as needed. |
794 |
- if (isset($this->smcFunc['json_encode']) && is_callable($this->smcFunc['json_encode'])) |
|
820 |
+ if (isset($this->smcFunc['json_encode']) && is_callable($this->smcFunc['json_encode'])) { |
|
795 | 821 |
return $this->smcFunc['json_encode']($requestData); |
822 |
+ } |
|
796 | 823 |
// Back to the basics. |
797 |
- else |
|
798 |
- { |
|
824 |
+ |
|
825 |
+ |
|
799 | 826 |
$data = @json_encode($requestData); |
800 | 827 |
|
801 | 828 |
// We got a error, return nothing. Don't log this, not worth it. |
802 |
- if (json_last_error() !== JSON_ERROR_NONE) |
|
829 |
+ if (json_last_error() !== JSON_ERROR_NONE) { |
|
803 | 830 |
return null; |
804 |
- return $data; |
|
805 | 831 |
} |
832 |
+ |
|
833 |
+ return $data; |
|
834 |
+ |
|
806 | 835 |
} |
807 | 836 |
|
808 | 837 |
/** |
... | ... |
@@ -818,8 +847,9 @@ class SFS |
818 | 847 |
private function buildServerURL(): string |
819 | 848 |
{ |
820 | 849 |
// If we build this once, don't do it again. |
821 |
- if (!empty($this->requestURL)) |
|
850 |
+ if (!empty($this->requestURL)) { |
|
822 | 851 |
return $this->requestURL; |
852 |
+ } |
|
823 | 853 |
|
824 | 854 |
// Get our server info. |
825 | 855 |
$server = $this->sfsServerMapping()[$this->modSettings['sfs_region']]; |
... | ... |
@@ -835,20 +865,24 @@ class SFS |
835 | 865 |
]; |
836 | 866 |
|
837 | 867 |
// Maybe only certain wildcards are ignored? |
838 |
- if (empty($sfsMap['nobadall'])) |
|
868 |
+ if (empty($sfsMap['nobadall'])) { |
|
839 | 869 |
$sfsMap += [ |
840 | 870 |
'nobadusername' => !empty($this->modSettings['sfs_wildcard_email']), |
841 | 871 |
'nobademail' => !empty($this->modSettings['sfs_wildcard_username']), |
842 | 872 |
'nobadip' => !empty($this->modSettings['sfs_wildcard_ip']), |
843 | 873 |
]; |
874 |
+ } |
|
844 | 875 |
|
845 | 876 |
// Do we have to filter out from lastseen? |
846 |
- if (!empty($this->modSettings['sfs_expire'])) |
|
877 |
+ if (!empty($this->modSettings['sfs_expire'])) { |
|
847 | 878 |
$sfsMap['expire=' . (int) $this->modSettings['sfs_expire']] = true; |
879 |
+ } |
|
848 | 880 |
|
849 |
- foreach ($sfsMap as $val => $key) |
|
850 |
- if (!empty($key)) |
|
881 |
+ foreach ($sfsMap as $val => $key) { |
|
882 |
+ if (!empty($key)) { |
|
851 | 883 |
$this->requestURL .= '&' . $val; |
884 |
+ } |
|
885 |
+ } |
|
852 | 886 |
|
853 | 887 |
return $this->requestURL; |
854 | 888 |
} |
... | ... |
@@ -885,9 +919,10 @@ class SFS |
885 | 919 |
]; |
886 | 920 |
|
887 | 921 |
// Configs only need the labels. |
888 |
- if ($returnType == 'config') |
|
922 |
+ if ($returnType == 'config') { |
|
889 | 923 |
// array_column does not preserve keys, but this is in order already. |
890 | 924 |
return array_column($serverList, 'label'); |
925 |
+ } |
|
891 | 926 |
|
892 | 927 |
return $serverList; |
893 | 928 |
} |
... | ... |
@@ -909,17 +944,18 @@ class SFS |
909 | 944 |
// Standard options. |
910 | 945 |
$options = $this->Decode($this->modSettings[$optionsKey] ?? ''); |
911 | 946 |
|
912 |
- if (empty($options) || !is_array($options)) |
|
947 |
+ if (empty($options) || !is_array($options)) { |
|
913 | 948 |
$options = []; |
949 |
+ } |
|
914 | 950 |
|
915 | 951 |
// Extras. |
916 |
- if (!empty($this->modSettings[$optionsKeyExtra])) |
|
917 |
- { |
|
952 |
+ if (!empty($this->modSettings[$optionsKeyExtra])) { |
|
918 | 953 |
$this->extraVerificationOptions = explode(',', $this->modSettings[$optionsKeyExtra]); |
919 | 954 |
|
920 |
- if (!empty($this->extraVerificationOptions)) |
|
955 |
+ if (!empty($this->extraVerificationOptions)) { |
|
921 | 956 |
$options = array_merge($options, $this->extraVerificationOptions); |
922 | 957 |
} |
958 |
+ } |
|
923 | 959 |
|
924 | 960 |
return $options; |
925 | 961 |
} |
... | ... |
@@ -934,27 +970,27 @@ class SFS |
934 | 970 |
* @CalledIn SMF 2.0, SMF 2.1 |
935 | 971 |
* @version 1.5.0 |
936 | 972 |
* @since 1.0 |
937 |
- * @return void Nothing is returned, we inject into $modSettings. |
|
938 | 973 |
*/ |
939 | 974 |
public function loadDefaults(bool $undo = false): bool |
940 | 975 |
{ |
941 | 976 |
$this->defaultSettings['sfs_verification_options'] = $this->Stringify(['post']); |
942 | 977 |
|
943 | 978 |
// We undoing this? Maybe a save? |
944 |
- if ($undo) |
|
945 |
- { |
|
946 |
- foreach ($this->changedSettings as $key => $value) |
|
979 |
+ if ($undo) { |
|
980 |
+ foreach ($this->changedSettings as $key => $value) { |
|
947 | 981 |
unset($this->modSettings[$key], $this->changedSettings[$key]); |
982 |
+ } |
|
983 |
+ |
|
948 | 984 |
return true; |
949 | 985 |
} |
950 | 986 |
|
951 | 987 |
// Enabled settings. |
952 |
- foreach ($this->defaultSettings as $key => $value) |
|
953 |
- if (!isset($this->modSettings[$key])) |
|
954 |
- { |
|
988 |
+ foreach ($this->defaultSettings as $key => $value) { |
|
989 |
+ if (!isset($this->modSettings[$key])) { |
|
955 | 990 |
$this->changedSettings[$key] = null; |
956 | 991 |
$this->modSettings[$key] = $value; |
957 | 992 |
} |
993 |
+ } |
|
958 | 994 |
|
959 | 995 |
return true; |
960 | 996 |
} |
... | ... |
@@ -966,7 +1002,6 @@ class SFS |
966 | 1002 |
* @CalledIn SMF 2.0, SMF 2.1 |
967 | 1003 |
* @version 1.5.0 |
968 | 1004 |
* @since 1.0 |
969 |
- * @return void Nothing is returned, we inject into $modSettings. |
|
970 | 1005 |
*/ |
971 | 1006 |
public function unloadDefaults(): bool |
972 | 1007 |
{ |
... | ... |
@@ -988,13 +1023,16 @@ class SFS |
988 | 1023 |
public function versionCheck(array|string $version, string $software = 'smf'): bool |
989 | 1024 |
{ |
990 | 1025 |
// We can't do this if the software doesn't match. |
991 |
- if ($software !== $this->softwareName) |
|
1026 |
+ if ($software !== $this->softwareName) { |
|
992 | 1027 |
return false; |
1028 |
+ } |
|
993 | 1029 |
|
994 | 1030 |
// Allow multiple versions to pass. |
995 |
- foreach ((array) $version as $v) |
|
996 |
- if ($v == $this->softwareVersion) |
|
1031 |
+ foreach ((array) $version as $v) { |
|
1032 |
+ if ($v == $this->softwareVersion) { |
|
997 | 1033 |
return true; |
1034 |
+ } |
|
1035 |
+ } |
|
998 | 1036 |
|
999 | 1037 |
// No match? False. |
1000 | 1038 |
return false; |
... | ... |
@@ -1008,7 +1046,6 @@ class SFS |
1008 | 1046 |
* @CalledIn SMF 2.0, SMF 2.1 |
1009 | 1047 |
* @version 1.5.0 |
1010 | 1048 |
* @since 1.0 |
1011 |
- * @return void No return is generated here. |
|
1012 | 1049 |
*/ |
1013 | 1050 |
public function loadLanguage(array|string $languages = 'StopForumSpam'): string |
1014 | 1051 |
{ |
... | ... |
@@ -1028,11 +1065,13 @@ class SFS |
1028 | 1065 |
public function txt($key): string |
1029 | 1066 |
{ |
1030 | 1067 |
// Load the language if its not here already. |
1031 |
- if (!isset($this->txt[$key])) |
|
1068 |
+ if (!isset($this->txt[$key])) { |
|
1032 | 1069 |
$this->loadLanguage(); |
1070 |
+ } |
|
1033 | 1071 |
|
1034 |
- if (!isset($this->txt[$key])) |
|
1072 |
+ if (!isset($this->txt[$key])) { |
|
1035 | 1073 |
return ''; |
1074 |
+ } |
|
1036 | 1075 |
|
1037 | 1076 |
return $this->txt[$key]; |
1038 | 1077 |
} |
... | ... |
@@ -1047,8 +1086,10 @@ class SFS |
1047 | 1086 |
private function Stringify($data): string |
1048 | 1087 |
{ |
1049 | 1088 |
$encodeFunc = 'json_encode'; |
1050 |
- if ($this->versionCheck('2.0', 'smf')) |
|
1089 |
+ |
|
1090 |
+ if ($this->versionCheck('2.0', 'smf')) { |
|
1051 | 1091 |
$encodeFunc = 'serialize'; |
1092 |
+ } |
|
1052 | 1093 |
|
1053 | 1094 |
return $encodeFunc($data); |
1054 | 1095 |
} |
... | ... |
@@ -1062,14 +1103,18 @@ class SFS |
1062 | 1103 |
*/ |
1063 | 1104 |
private function Decode(string $data): ?array |
1064 | 1105 |
{ |
1065 |
- if (empty($data)) |
|
1106 |
+ if (empty($data)) { |
|
1066 | 1107 |
return null; |
1108 |
+ } |
|
1067 | 1109 |
|
1068 |
- if ($this->versionCheck('2.0', 'smf') && !empty($data)) |
|
1110 |
+ if ($this->versionCheck('2.0', 'smf') && !empty($data)) { |
|
1069 | 1111 |
return safe_unserialize($data); |
1070 |
- elseif (!empty($data)) |
|
1112 |
+ } |
|
1113 |
+ |
|
1114 |
+ if (!empty($data)) { |
|
1071 | 1115 |
return $this->decodeJSON($data); |
1072 | 1116 |
} |
1117 |
+ } |
|
1073 | 1118 |
|
1074 | 1119 |
/* |
1075 | 1120 |
* Wrapper for validateToken. |
... | ... |
@@ -1081,8 +1126,10 @@ class SFS |
1081 | 1126 |
*/ |
1082 | 1127 |
public function createToken($action, $type = 'post'): ?array |
1083 | 1128 |
{ |
1084 |
- if (!$this->versionCheck('2.0', 'smf')) |
|
1129 |
+ if (!$this->versionCheck('2.0', 'smf')) { |
|
1085 | 1130 |
return createToken($action, $type); |
1131 |
+ } |
|
1132 |
+ |
|
1086 | 1133 |
return null; |
1087 | 1134 |
} |
1088 | 1135 |
|
... | ... |
@@ -1096,8 +1143,10 @@ class SFS |
1096 | 1143 |
*/ |
1097 | 1144 |
public function validateToken($action, $type = 'post', $reset = true): bool |
1098 | 1145 |
{ |
1099 |
- if (!$this->versionCheck('2.0', 'smf')) |
|
1146 |
+ if (!$this->versionCheck('2.0', 'smf')) { |
|
1100 | 1147 |
return validateToken($action, $type, $reset); |
1148 |
+ } |
|
1149 |
+ |
|
1101 | 1150 |
return true; |
1102 | 1151 |
} |
1103 | 1152 |
|
... | ... |
@@ -1111,7 +1160,7 @@ class SFS |
1111 | 1160 |
public function loadSources(array|string $sources): void |
1112 | 1161 |
{ |
1113 | 1162 |
array_map(function ($rs) { |
1114 |
- require_once($GLOBALS['sourcedir'] . DIRECTORY_SEPARATOR . strtr($rs, ['SFS' => 'StopForumSpam' . DIRECTORY_SEPARATOR . 'SFS']) . '.php'); |
|
1163 |
+ require_once $GLOBALS['sourcedir'] . DIRECTORY_SEPARATOR . strtr($rs, ['SFS' => 'StopForumSpam' . DIRECTORY_SEPARATOR . 'SFS']) . '.php'; |
|
1115 | 1164 |
}, (array) $sources); |
1116 | 1165 |
} |
1117 | 1166 |
|
... | ... |
@@ -1144,9 +1193,10 @@ class SFS |
1144 | 1193 |
*/ |
1145 | 1194 |
public function get(string $variable) |
1146 | 1195 |
{ |
1147 |
- if (in_array($variable, ['softwareName', 'softwareVersion'])) |
|
1196 |
+ if (in_array($variable, ['softwareName', 'softwareVersion'])) { |
|
1148 | 1197 |
return $this->{$variable}; |
1149 | 1198 |
} |
1199 |
+ } |
|
1150 | 1200 |
|
1151 | 1201 |
/** |
1152 | 1202 |
* The hook to setup quick buttons menu. |
... | ... |
@@ -1158,7 +1208,6 @@ class SFS |
1158 | 1208 |
* @version 1.5.0 |
1159 | 1209 |
* @since 1.4.0 |
1160 | 1210 |
* @uses integrate_prepare_display_context - Hook SMF2.1 |
1161 |
- * @return void We update the output to add the more action for SFS. |
|
1162 | 1211 |
*/ |
1163 | 1212 |
public static function hook_prepare_display_context(&$output, &$message, $counter): void |
1164 | 1213 |
{ |
... | ... |
@@ -1168,7 +1217,7 @@ class SFS |
1168 | 1217 |
'label' => $smcFunc['classSFS']->txt('sfs_admin_area'), |
1169 | 1218 |
'href' => $scripturl . '?action=profile;area=sfs;u=' . $output['member']['id'] . ';msg=' . $output['id'], |
1170 | 1219 |
'icon' => 'sfs', |
1171 |
- 'show' => $context['can_moderate_forum'] |
|
1220 |
+ 'show' => $context['can_moderate_forum'], |
|
1172 | 1221 |
]; |
1173 | 1222 |
} |
1174 | 1223 |
|
... | ... |
@@ -1182,7 +1231,6 @@ class SFS |
1182 | 1231 |
* @version 1.4.0 |
1183 | 1232 |
* @since 1.4.0 |
1184 | 1233 |
* @uses integrate_mod_buttons - Hook SMF2.1 |
1185 |
- * @return void We add some css. |
|
1186 | 1234 |
*/ |
1187 | 1235 |
public static function hook_mod_buttons(&$mod_buttons): void |
1188 | 1236 |
{ |
... | ... |
@@ -4,16 +4,18 @@ function template_profile_tracksfs() |
4 | 4 |
{ |
5 | 5 |
global $txt, $context, $scripturl; |
6 | 6 |
|
7 |
- if (!empty($context['submission_success'])) |
|
7 |
+ if (!empty($context['submission_success'])) { |
|
8 | 8 |
echo ' |
9 | 9 |
<div class="infobox">', $context['submission_success'] , '</div>'; |
10 |
- elseif (!empty($context['submission_failed'])) |
|
10 |
+ } elseif (!empty($context['submission_failed'])) { |
|
11 | 11 |
echo ' |
12 | 12 |
<div class="errorbox">', $context['submission_failed'], '</div>'; |
13 |
+ } |
|
13 | 14 |
|
14 |
- if (!empty($context['sfs_allow_submit'])) |
|
15 |
+ if (!empty($context['sfs_allow_submit'])) { |
|
15 | 16 |
echo ' |
16 | 17 |
<form action="', $context['sfs_submit_url'], '" method="post">'; |
18 |
+ } |
|
17 | 19 |
|
18 | 20 |
echo ' |
19 | 21 |
<div class="tborder"> |
... | ... |
@@ -31,15 +33,17 @@ function template_profile_tracksfs() |
31 | 33 |
</thead> |
32 | 34 |
<tbody>'; |
33 | 35 |
|
34 |
- foreach ($context['sfs_checks'] as $id_check => $checkGrp) |
|
35 |
- foreach ($checkGrp as $check) |
|
36 |
+ foreach ($context['sfs_checks'] as $id_check => $checkGrp) { |
|
37 |
+ foreach ($checkGrp as $check) { |
|
36 | 38 |
template_sfsa_result_row($id_check, $check, true); |
39 |
+ } |
|
40 |
+ } |
|
37 | 41 |
|
38 | 42 |
echo ' |
39 | 43 |
</tbody> |
40 | 44 |
</table>'; |
41 | 45 |
|
42 |
- if (!empty($context['sfs_allow_submit'])) |
|
46 |
+ if (!empty($context['sfs_allow_submit'])) { |
|
43 | 47 |
echo ' |
44 | 48 |
<br> |
45 | 49 |
<div> |
... | ... |
@@ -55,18 +59,19 @@ function template_profile_tracksfs() |
55 | 59 |
</div> |
56 | 60 |
</div> |
57 | 61 |
</div>'; |
62 |
+ } |
|
58 | 63 |
|
59 | 64 |
echo ' |
60 | 65 |
</div><!-- .tborder -->'; |
61 | 66 |
|
62 |
- if (!empty($context['sfs_allow_submit'])) |
|
63 |
- { |
|
67 |
+ if (!empty($context['sfs_allow_submit'])) { |
|
64 | 68 |
echo ' |
65 | 69 |
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">'; |
66 | 70 |
|
67 |
- if (!empty($context['token_check'])) |
|
71 |
+ if (!empty($context['token_check'])) { |
|
68 | 72 |
echo ' |
69 | 73 |
<input type="hidden" name="' . $context[$context['token_check'] . '_token_var'] . '" value="' . $context[$context['token_check'] . '_token'] . '">'; |
74 |
+ } |
|
70 | 75 |
|
71 | 76 |
echo ' |
72 | 77 |
</form>'; |
... | ... |
@@ -107,9 +112,10 @@ function template_sfsa_testapi() |
107 | 112 |
<input type="submit" name="send" value="', $txt['sfs_testapi_submit'], '" tabindex="', $context['tabindex']++, '" class="button"> |
108 | 113 |
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">'; |
109 | 114 |
|
110 |
- if (!empty($context['token_check'])) |
|
115 |
+ if (!empty($context['token_check'])) { |
|
111 | 116 |
echo ' |
112 | 117 |
<input type="hidden" name="' . $context[$context['token_check'] . '_token_var'] . '" value="' . $context[$context['token_check'] . '_token'] . '">'; |
118 |
+ } |
|
113 | 119 |
|
114 | 120 |
echo ' |
115 | 121 |
</div> |
... | ... |
@@ -119,8 +125,9 @@ function template_sfsa_testapi() |
119 | 125 |
<br class="clear">'; |
120 | 126 |
|
121 | 127 |
// Do not show results yet. |
122 |
- if (empty($context['test_sent'])) |
|
128 |
+ if (empty($context['test_sent'])) { |
|
123 | 129 |
return; |
130 |
+ } |
|
124 | 131 |
|
125 | 132 |
template_sfsa_testapi_results(); |
126 | 133 |
} |
... | ... |
@@ -145,9 +152,11 @@ function template_sfsa_testapi_results() |
145 | 152 |
</thead> |
146 | 153 |
<tbody>'; |
147 | 154 |
|
148 |
- foreach ($context['sfs_checks'] as $id_check => $checkGrp) |
|
149 |
- foreach ($checkGrp as $check) |
|
155 |
+ foreach ($context['sfs_checks'] as $id_check => $checkGrp) { |
|
156 |
+ foreach ($checkGrp as $check) { |
|
150 | 157 |
template_sfsa_result_row($id_check, $check); |
158 |
+ } |
|
159 |
+ } |
|
151 | 160 |
|
152 | 161 |
echo ' |
153 | 162 |
</tbody> |
... | ... |
@@ -164,8 +173,9 @@ function template_sfsa_result_row(string $id_check, array $check, bool $show_ip |
164 | 173 |
', $txt['sfs_check_' . $id_check]; |
165 | 174 |
|
166 | 175 |
// Show the IP we tested. |
167 |
- if ($show_ip && $id_check === 'ip') |
|
176 |
+ if ($show_ip && $id_check === 'ip') { |
|
168 | 177 |
echo ' <span class="smalltext">(', $check['value'], ')</span>'; |
178 |
+ } |
|
169 | 179 |
|
170 | 180 |
echo ' |
171 | 181 |
</td> |
... | ... |
@@ -176,22 +186,27 @@ function template_sfsa_result_row(string $id_check, array $check, bool $show_ip |
176 | 186 |
', (!empty($check['appears']) ? $txt['yes'] : $txt['no']); |
177 | 187 |
|
178 | 188 |
// Some checks will show the last seen, convert it and show it. |
179 |
- if (!empty($check['lastseen'])) |
|
189 |
+ if (!empty($check['lastseen'])) { |
|
180 | 190 |
echo '<br>' . $txt['sfs_last_seen'] . ': ' . timeformat(strtotime($check['lastseen'])); |
191 |
+ } |
|
181 | 192 |
|
182 |
- if (!empty($check['confidence'])) |
|
193 |
+ if (!empty($check['confidence'])) { |
|
183 | 194 |
echo '<br>' . $txt['sfs_confidence'] . ': ' . $check['confidence']; |
195 |
+ } |
|
184 | 196 |
|
185 |
- if (!empty($check['frequency'])) |
|
197 |
+ if (!empty($check['frequency'])) { |
|
186 | 198 |
echo '<br>' . $txt['sfs_frequency'] . ': ' . $check['frequency']; |
199 |
+ } |
|
187 | 200 |
|
188 | 201 |
// IP address may be normalized |
189 |
- if (!empty($check['torexit'])) |
|
202 |
+ if (!empty($check['torexit'])) { |
|
190 | 203 |
echo '<br>' . $txt['sfs_torexit']; |
204 |
+ } |
|
191 | 205 |
|
192 | 206 |
// IP address may be normalized |
193 |
- if (!empty($check['asn'])) |
|
207 |
+ if (!empty($check['asn'])) { |
|
194 | 208 |
echo '<br><a href="', $scripturl, '?action=profile;area=tracking;sa=ip;searchip=' . urlencode(str_replace('::*', ':*', !empty($check['normalized']) ? $check['normalized'] . '*' : $check['value'])) . '">', $txt['ip_address'], ' ', (!empty($check['normalized']) ? $check['normalized'] . '*' : $check['value']), '</a>'; |
209 |
+ } |
|
195 | 210 |
|
196 | 211 |
echo ' |
197 | 212 |
</td> |
... | ... |
@@ -45,8 +45,9 @@ class SFSA |
45 | 45 |
*/ |
46 | 46 |
public static function selfClass(): self |
47 | 47 |
{ |
48 |
- if (!isset($GLOBALS['context']['instances'][__CLASS__])) |
|
48 |
+ if (!isset($GLOBALS['context']['instances'][__CLASS__])) { |
|
49 | 49 |
$GLOBALS['context']['instances'][__CLASS__] = new self(); |
50 |
+ } |
|
50 | 51 |
|
51 | 52 |
return $GLOBALS['context']['instances'][__CLASS__]; |
52 | 53 |
} |
... | ... |
@@ -58,13 +59,14 @@ class SFSA |
58 | 59 |
* @CalledIn SMF 2.0, SMF 2.1 |
59 | 60 |
* @version 1.5.0 |
60 | 61 |
* @since 1.0 |
61 |
- * @return void No return is generated |
|
62 | 62 |
*/ |
63 | 63 |
public function __construct() |
64 | 64 |
{ |
65 | 65 |
$this->scripturl = $GLOBALS['scripturl']; |
66 |
- foreach (['context', 'smcFunc', 'txt', 'modSettings', 'user_info'] as $f) |
|
66 |
+ |
|
67 |
+ foreach (['context', 'smcFunc', 'txt', 'modSettings', 'user_info'] as $f) { |
|
67 | 68 |
$this->{$f} = &$GLOBALS[$f]; |
69 |
+ } |
|
68 | 70 |
|
69 | 71 |
$this->SFSclass = &$this->smcFunc['classSFS']; |
70 | 72 |
} |
... | ... |
@@ -81,7 +83,6 @@ class SFSA |
81 | 83 |
* @since 1.0 |
82 | 84 |
* @uses integrate__admin_areas - Hook SMF2.0 |
83 | 85 |
* @uses integrate__admin_areas - Hook SMF2.1 |
84 |
- * @return void No return is generated |
|
85 | 86 |
*/ |
86 | 87 |
public static function hook_admin_areas(array &$admin_areas): void |
87 | 88 |
{ |
... | ... |
@@ -100,31 +101,27 @@ class SFSA |
100 | 101 |
* @since 1.0 |
101 | 102 |
* @uses integrate__admin_areas - Hook SMF2.0 |
102 | 103 |
* @uses integrate__admin_areas - Hook SMF2.1 |
103 |
- * @return void No return is generated |
|
104 | 104 |
*/ |
105 | 105 |
private function setupAdminAreas(array &$admin_areas): void |
106 | 106 |
{ |
107 | 107 |
// The main config is the same. |
108 | 108 |
$this->adminPageURL = $this->scripturl . '?action=admin;area=modsettings;sa=sfs'; |
109 | 109 |
$admin_areas['config']['areas']['modsettings']['subsections']['sfs'] = [ |
110 |
- $this->SFSclass->txt('sfs_admin_area') |
|
110 |
+ $this->SFSclass->txt('sfs_admin_area'), |
|
111 | 111 |
]; |
112 | 112 |
|
113 | 113 |
// Add the menu item. |
114 |
- if ($this->SFSclass->versionCheck('2.0', 'smf')) |
|
115 |
- { |
|
114 |
+ if ($this->SFSclass->versionCheck('2.0', 'smf')) { |
|
116 | 115 |
$this->adminLogURL = $this->scripturl . '?action=admin;area=modsettings;sa=sfslog'; |
117 | 116 |
$this->adminTestURL = $this->scripturl . '?action=admin;area=modsettings;sa=sfstest'; |
118 | 117 |
|
119 | 118 |
$admin_areas['config']['areas']['modsettings']['subsections']['sfslog'] = [ |
120 |
- $this->SFSclass->txt('sfs_admin_logs') |
|
119 |
+ $this->SFSclass->txt('sfs_admin_logs'), |
|
121 | 120 |
]; |
122 | 121 |
$admin_areas['config']['areas']['modsettings']['subsections']['sfstest'] = [ |
123 |
- $this->SFSclass->txt('sfs_admin_test') |
|
122 |
+ $this->SFSclass->txt('sfs_admin_test'), |
|
124 | 123 |
]; |
125 |
- } |
|
126 |
- else |
|
127 |
- { |
|
124 |
+ } else { |
|
128 | 125 |
$this->adminLogURL = $this->scripturl . '?action=admin;area=logs;sa=sfslog'; |
129 | 126 |
$this->adminTestURL = $this->scripturl . '?action=admin;area=regcenter;sa=sfstest'; |
130 | 127 |
|
... | ... |
@@ -132,7 +129,7 @@ class SFSA |
132 | 129 |
$this->SFSclass->txt('sfs_admin_logs'), |
133 | 130 |
]; |
134 | 131 |
$admin_areas['members']['areas']['regcenter']['subsections']['sfstest'] = [ |
135 |
- $this->SFSclass->txt('sfs_admin_test') |
|
132 |
+ $this->SFSclass->txt('sfs_admin_test'), |
|
136 | 133 |
]; |
137 | 134 |
} |
138 | 135 |
} |
... | ... |
@@ -150,7 +147,6 @@ class SFSA |
150 | 147 |
* @since 1.0 |
151 | 148 |
* @uses integrate_modify_modifications - Hook SMF2.0 |
152 | 149 |
* @uses integrate_modify_modifications - Hook SMF2.1 |
153 |
- * @return void No return is generated |
|
154 | 150 |
*/ |
155 | 151 |
public static function hook_modify_modifications(array &$subActions): void |
156 | 152 |
{ |
... | ... |
@@ -169,15 +165,13 @@ class SFSA |
169 | 165 |
* @since 1.0 |
170 | 166 |
* @uses integrate_modify_modifications - Hook SMF2.0 |
171 | 167 |
* @uses integrate_modify_modifications - Hook SMF2.1 |
172 |
- * @return void No return is generated |
|
173 | 168 |
*/ |
174 | 169 |
private function setupModifyModifications(array &$subActions): void |
175 | 170 |
{ |
176 | 171 |
$subActions['sfs'] = 'SFSA::startupAdminConfiguration'; |
177 | 172 |
|
178 | 173 |
// Only in SMF 2.0 do we drop logs here. |
179 |
- if ($this->SFSclass->versionCheck('2.0', 'smf')) |
|
180 |
- { |
|
174 |
+ if ($this->SFSclass->versionCheck('2.0', 'smf')) { |
|
181 | 175 |
$this->SFSclass->loadSources(['SFS-Logs']); |
182 | 176 |
$subActions['sfslog'] = 'SFSL::startupLogs'; |
183 | 177 |
$subActions['sfstest'] = 'SFSA::startupTest'; |
... | ... |
@@ -196,7 +190,6 @@ class SFSA |
196 | 190 |
* @since 1.0 |
197 | 191 |
* @uses integrate_modify_modifications - Hook SMF2.0 |
198 | 192 |
* @uses integrate_modify_modifications - Hook SMF2.1 |
199 |
- * @return void No return is generated |
|
200 | 193 |
*/ |
201 | 194 |
public static function startupAdminConfiguration(bool $return_config = false) |
202 | 195 |
{ |
... | ... |
@@ -214,18 +207,19 @@ class SFSA |
214 | 207 |
* @since 1.0 |
215 | 208 |
* @uses integrate_modify_modifications - Hook SMF2.0 |
216 | 209 |
* @uses integrate_modify_modifications - Hook SMF2.1 |
217 |
- * @return void No return is generated |
|
218 | 210 |
*/ |
219 | 211 |
private function setupSFSConfiguration(bool $return_config = false): array |
220 | 212 |
{ |
221 | 213 |
$config_vars = $this->getConfiguration(); |
222 | 214 |
|
223 |
- if ($return_config) |
|
215 |
+ if ($return_config) { |
|
224 | 216 |
return $config_vars; |
217 |
+ } |
|
225 | 218 |
|
226 | 219 |
// Saving? |
227 |
- if (isset($_GET['save'])) |
|
220 |
+ if (isset($_GET['save'])) { |
|
228 | 221 |
$this->saveConfiguration($config_vars); |
222 |
+ } |
|
229 | 223 |
|
230 | 224 |
$this->context['post_url'] = $this->adminPageURL . ';save'; |
231 | 225 |
prepareDBSettingContext($config_vars); |
... | ... |
@@ -242,7 +236,6 @@ class SFSA |
242 | 236 |
* @CalledIn SMF 2.0, SMF 2.1 |
243 | 237 |
* @version 1.5.0 |
244 | 238 |
* @since 1.5.0 |
245 |
- * @return void No return is generated |
|
246 | 239 |
*/ |
247 | 240 |
private function getConfiguration(): array |
248 | 241 |
{ |
... | ... |
@@ -310,7 +303,6 @@ class SFSA |
310 | 303 |
* @CalledIn SMF 2.0, SMF 2.1 |
311 | 304 |
* @version 1.5.0 |
312 | 305 |
* @since 1.5.0 |
313 |
- * @return void No return is generated |
|
314 | 306 |
*/ |
315 | 307 |
private function saveConfiguration(array $config_vars): void |
316 | 308 |
{ |
... | ... |
@@ -319,8 +311,7 @@ class SFSA |
319 | 311 |
checkSession(); |
320 | 312 |
|
321 | 313 |
// If we are automatically banning IPs, make sure we have a ban group. |
322 |
- if (isset($_POST['sfs_ipcheck_autoban']) && empty($this->modSettings['sfs_ipcheck_autoban_group'])) |
|
323 |
- { |
|
314 |
+ if (isset($_POST['sfs_ipcheck_autoban']) && empty($this->modSettings['sfs_ipcheck_autoban_group'])) { |
|
324 | 315 |
$this->SFSclass->loadSources('SFS-Bans'); |
325 | 316 |
SFSB::AdminCreateBanGroup(true); |
326 | 317 |
} |
... | ... |
@@ -343,7 +334,6 @@ class SFSA |
343 | 334 |
* @version 1.5.0 |
344 | 335 |
* @since 1.4.0 |
345 | 336 |
* @uses integrate_manage_registrations - Hook SMF2.1 |
346 |
- * @return void No return is generated |
|
347 | 337 |
*/ |
348 | 338 |
public static function hook_manage_registrations(array &$subActions): bool |
349 | 339 |
{ |
... | ... |
@@ -359,15 +349,15 @@ class SFSA |
359 | 349 |
* @See SFSA::startupTest |
360 | 350 |
* @version 1.5.0 |
361 | 351 |
* @since 1.4.0 |
362 |
- * @return void No return is generated |
|
363 | 352 |
*/ |
364 | 353 |
public function AddToRegCenterMenu(array &$subActions): bool |
365 | 354 |
{ |
366 | 355 |
// Add our logs sub action. |
367 | 356 |
$subActions['sfstest'] = ['SFSA::startupTest', 'admin_forum']; |
368 | 357 |
|
369 |
- if (isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'sfstest' && allowedTo('admin_forum')) |
|
358 |
+ if (isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'sfstest' && allowedTo('admin_forum')) { |
|
370 | 359 |
$this->context['sub_action'] = 'sfstest'; |
360 |
+ } |
|
371 | 361 |
|
372 | 362 |
$this->context[$this->context['admin_menu_name']]['tab_data']['tabs']['sfstest'] = [ |
373 | 363 |
'description' => $this->SFSclass->txt('sfs_admin_test_desc'), |
... | ... |
@@ -389,7 +379,6 @@ class SFSA |
389 | 379 |
* @since 1.4.0 |
390 | 380 |
* @uses hook_manage_registrations - Hook SMF2.1 |
391 | 381 |
* @uses setupModifyModifications - Injected SMF2.0 |
392 |
- * @return void No return is generated |
|
393 | 382 |
*/ |
394 | 383 |
public static function startupTest(bool $return_config = false): array |
395 | 384 |
{ |
... | ... |
@@ -408,13 +397,13 @@ class SFSA |
408 | 397 |
* @since 1.4.0 |
409 | 398 |
* @uses hook_manage_registrations - Hook SMF2.1 |
410 | 399 |
* @uses setupModifyModifications - Injected SMF2.0 |
411 |
- * @return void No return is generated |
|
412 | 400 |
*/ |
413 | 401 |
public function loadTestAPI(bool $return_config = false): array |
414 | 402 |
{ |
415 | 403 |
// No Configs. |
416 |
- if ($return_config) |
|
404 |
+ if ($return_config) { |
|
417 | 405 |
return []; |
406 |
+ } |
|
418 | 407 |
|
419 | 408 |
$this->context['token_check'] = 'sfs_testapi'; |
420 | 409 |
$this->SFSclass->loadLanguage(); |
... | ... |
@@ -424,16 +413,19 @@ class SFSA |
424 | 413 |
$this->context['sfs_checks'] = $this->loadTestApiChecks(); |
425 | 414 |
|
426 | 415 |
// Sending the data? |
427 |
- if ($this->context['test_sent']) |
|
416 |
+ if ($this->context['test_sent']) { |
|
428 | 417 |
$this->peformTestApiCheck(); |
418 |
+ } |
|
429 | 419 |
|
430 | 420 |
// Load our template. |
431 | 421 |
$this->SFSclass->loadTemplate('StopForumSpam'); |
432 | 422 |
$this->context['sub_template'] = 'sfsa_testapi'; |
433 | 423 |
|
434 | 424 |
$this->context['sfs_test_url'] = $this->adminTestURL; |
435 |
- if (!$this->SFSclass->createToken($this->context['token_check'], 'post')) |
|
425 |
+ |
|
426 |
+ if (!$this->SFSclass->createToken($this->context['token_check'], 'post')) { |
|
436 | 427 |
unset($this->context['token_check']); |
428 |
+ } |
|
437 | 429 |
|
438 | 430 |
return []; |
439 | 431 |
} |
... | ... |
@@ -454,21 +446,21 @@ class SFSA |
454 | 446 |
0 => [ |
455 | 447 |
'enabled' => !empty($this->modSettings['sfs_usernamecheck']), |
456 | 448 |
'value' => !empty($_POST['username']) ? $this->smcFunc['htmlspecialchars']($_POST['username']) : $this->user_info['name'], |
457 |
- 'results' => null |
|
449 |
+ 'results' => null, |
|
458 | 450 |
], |
459 | 451 |
], |
460 | 452 |
'email' => [ |
461 | 453 |
0 => [ |
462 | 454 |
'enabled' => !empty($this->modSettings['sfs_emailcheck']), |
463 | 455 |
'value' => !empty($_POST['email']) ? $this->smcFunc['htmlspecialchars']($_POST['email']) : $this->user_info['email'], |
464 |
- 'results' => null |
|
456 |
+ 'results' => null, |
|
465 | 457 |
], |
466 | 458 |
], |
467 | 459 |
'ip' => [ |
468 | 460 |
0 => [ |
469 | 461 |
'enabled' => !empty($this->modSettings['sfs_ipcheck']), |
470 | 462 |
'value' => !empty($_POST['ip']) ? $this->smcFunc['htmlspecialchars']($_POST['ip']) : $this->user_info['ip'], |
471 |
- 'results' => null |
|
463 |
+ 'results' => null, |
|
472 | 464 |
], |
473 | 465 |
], |
474 | 466 |
]; |
... | ... |
@@ -499,11 +491,13 @@ class SFSA |
499 | 491 |
], 'test'); |
500 | 492 |
|
501 | 493 |
// No checks found? Can't do this. |
502 |
- if (empty($response) || !is_array($response) || empty($response['success'])) |
|
494 |
+ if (empty($response) || !is_array($response) || empty($response['success'])) { |
|
503 | 495 |
$this->context['test_api_error'] = $this->SFSclass->txt('sfs_request_failure_nodata'); |
504 |
- else |
|
496 |
+ } else { |
|
505 | 497 |
// Parse all the responses out. |
506 |
- foreach ($this->context['sfs_checks'] as $key => &$res) |
|
498 |
+ foreach ($this->context['sfs_checks'] as $key => &$res) { |
|
507 | 499 |
$res[0] += $response[$key][0] ?? []; |
508 | 500 |
} |
509 | 501 |
} |
502 |
+ } |
|
503 |
+} |
... | ... |
@@ -35,8 +35,9 @@ class SFSB |
35 | 35 |
*/ |
36 | 36 |
public static function selfClass(): self |
37 | 37 |
{ |
38 |
- if (!isset($GLOBALS['context']['instances'][__CLASS__])) |
|
38 |
+ if (!isset($GLOBALS['context']['instances'][__CLASS__])) { |
|
39 | 39 |
$GLOBALS['context']['instances'][__CLASS__] = new self(); |
40 |
+ } |
|
40 | 41 |
|
41 | 42 |
return $GLOBALS['context']['instances'][__CLASS__]; |
42 | 43 |
} |
... | ... |
@@ -48,13 +49,14 @@ class SFSB |
48 | 49 |
* @CalledIn SMF 2.0, SMF 2.1 |
49 | 50 |
* @version 1.5.0 |
50 | 51 |
* @since 1.0 |
51 |
- * @return void No return is generated |
|
52 | 52 |
*/ |
53 | 53 |
public function __construct() |
54 | 54 |
{ |
55 | 55 |
$this->scripturl = $GLOBALS['scripturl']; |
56 |
- foreach (['context', 'smcFunc', 'txt', 'modSettings', 'user_info'] as $f) |
|
56 |
+ |
|
57 |
+ foreach (['context', 'smcFunc', 'txt', 'modSettings', 'user_info'] as $f) { |
|
57 | 58 |
$this->{$f} = &$GLOBALS[$f]; |
59 |
+ } |
|
58 | 60 |
|
59 | 61 |
$this->SFSclass = &$this->smcFunc['classSFS']; |
60 | 62 |
} |
... | ... |
@@ -104,23 +106,24 @@ class SFSB |
104 | 106 |
public function BanNewIP(string $ip_address): bool |
105 | 107 |
{ |
106 | 108 |
// Did we loose our Ban Group? Try to fix this. |
107 |
- if (!empty($this->modSettings['sfs_ipcheck_autoban']) && empty($this->modSettings['sfs_ipcheck_autoban_group'])) |
|
109 |
+ if (!empty($this->modSettings['sfs_ipcheck_autoban']) && empty($this->modSettings['sfs_ipcheck_autoban_group'])) { |
|
108 | 110 |
$this->createBanGroup(); |
111 |
+ } |
|
109 | 112 |
|
110 | 113 |
// Still no Ban Group? Bail out. |
111 |
- if (empty($this->modSettings['sfs_ipcheck_autoban']) || empty($this->modSettings['sfs_ipcheck_autoban_group'])) |
|
114 |
+ if (empty($this->modSettings['sfs_ipcheck_autoban']) || empty($this->modSettings['sfs_ipcheck_autoban_group'])) { |
|
112 | 115 |
return false; |
116 |
+ } |
|
113 | 117 |
|
114 | 118 |
$this->SFSclass->loadSources('ManageBans'); |
115 | 119 |
|
116 | 120 |
// Did this work? |
117 |
- if ($this->doBanNewSpammer($ip_address)) |
|
118 |
- { |
|
121 |
+ if ($this->doBanNewSpammer($ip_address)) { |
|
119 | 122 |
// Log this. The log will show from the user/guest and ip of spammer. |
120 | 123 |
logAction('ban', [ |
121 | 124 |
'ip_range' => $ip_address, |
122 | 125 |
'new' => 1, |
123 |
- 'source' => 'sfs' |
|
126 |
+ 'source' => 'sfs', |
|
124 | 127 |
]); |
125 | 128 |
|
126 | 129 |
// Let things know we need updated ban data. |
... | ... |
@@ -144,13 +147,15 @@ class SFSB |
144 | 147 |
private function createBanGroup(bool $noChecks = false): bool |
145 | 148 |
{ |
146 | 149 |
// Is this disabled? Don't do it. |
147 |
- if (empty($noChecks) && empty($this->modSettings['sfs_ipcheck_autoban'])) |
|
150 |
+ if (empty($noChecks) && empty($this->modSettings['sfs_ipcheck_autoban'])) { |
|
148 | 151 |
return false; |
152 |
+ } |
|
149 | 153 |
|
150 | 154 |
$id_ban_group = $this->getBanGroup(); |
151 |
- if (!empty($id_ban_group)) |
|
152 |
- { |
|
155 |
+ |
|
156 |
+ if (!empty($id_ban_group)) { |
|
153 | 157 |
updateSettings(['sfs_ipcheck_autoban_group' => $id_ban_group]); |
158 |
+ |
|
154 | 159 |
return true; |
155 | 160 |
} |
156 | 161 |
|
... | ... |
@@ -167,23 +172,28 @@ class SFSB |
167 | 172 |
], |
168 | 173 |
'db_expiration' => 'NULL', |
169 | 174 |
'reason' => $this->SFSclass->txt('sfs_ban_group_reason'), |
170 |
- 'notes' => $this->SFSclass->txt('sfs_ban_group_notes') |
|
175 |
+ 'notes' => $this->SFSclass->txt('sfs_ban_group_notes'), |
|
171 | 176 |
]; |
172 | 177 |
|
173 | 178 |
// If we can shortcut this.. |
174 | 179 |
$ban_group_id = 0; |
175 |
- if (function_exists('insertBanGroup')) |
|
180 |
+ |
|
181 |
+ if (function_exists('insertBanGroup')) { |
|
176 | 182 |
$ban_group_id = insertBanGroup($ban_info); |
183 |
+ } |
|
177 | 184 |
|
178 | 185 |
// Fall back. |
179 |
- if (is_array($ban_group_id) || empty($ban_group_id)) |
|
186 |
+ if (is_array($ban_group_id) || empty($ban_group_id)) { |
|
180 | 187 |
$ban_group_id = $this->createBanGroupDirect($ban_info); |
188 |
+ } |
|
181 | 189 |
|
182 | 190 |
// Didn't work? Try again later. |
183 |
- if (empty($ban_group_id)) |
|
191 |
+ if (empty($ban_group_id)) { |
|
184 | 192 |
return false; |
193 |
+ } |
|
185 | 194 |
|
186 | 195 |
updateSettings(['sfs_ipcheck_autoban_group' => $ban_group_id]); |
196 |
+ |
|
187 | 197 |
return true; |
188 | 198 |
} |
189 | 199 |
|
... | ... |
@@ -199,25 +209,28 @@ class SFSB |
199 | 209 |
private function getBanGroup(): ?int |
200 | 210 |
{ |
201 | 211 |
// Maybe just got unlinked, if we can find the matching name, relink it. |
202 |
- $request = $this->smcFunc['db_query']('', ' |
|
212 |
+ $request = $this->smcFunc['db_query']( |
|
213 |
+ '', |
|
214 |
+ ' |
|
203 | 215 |
SELECT id_ban_group |
204 | 216 |
FROM {db_prefix}ban_groups |
205 | 217 |
WHERE name = {string:new_ban_name} |
206 | 218 |
LIMIT 1', |
207 | 219 |
[ |
208 | 220 |
'new_ban_name' => substr($this->SFSclass->txt('sfs_ban_group_name'), 0, 20), |
209 |
- ] |
|
221 |
+ ], |
|
210 | 222 |
); |
211 |
- if ($this->smcFunc['db_num_rows']($request) == 1) |
|
212 |
- { |
|
223 |
+ |
|
224 |
+ if ($this->smcFunc['db_num_rows']($request) == 1) { |
|
213 | 225 |
$ban_data = $this->smcFunc['db_fetch_assoc']($request); |
214 | 226 |
$this->smcFunc['db_free_result']($request); |
215 | 227 |
|
216 |
- if (!empty($ban_data['id_ban_group'])) |
|
228 |
+ if (!empty($ban_data['id_ban_group'])) { |
|
217 | 229 |
return $ban_data['id_ban_group']; |
218 | 230 |
} |
219 |
- else |
|
231 |
+ } else { |
|
220 | 232 |
$this->smcFunc['db_free_result']($request); |
233 |
+ } |
|
221 | 234 |
|
222 | 235 |
return null; |
223 | 236 |
} |
... | ... |
@@ -235,7 +248,8 @@ class SFSB |
235 | 248 |
*/ |
236 | 249 |
private function createBanGroupDirect(array $ban_info): int |
237 | 250 |
{ |
238 |
- $this->smcFunc['db_insert']('', |
|
251 |
+ $this->smcFunc['db_insert']( |
|
252 |
+ '', |
|
239 | 253 |
'{db_prefix}ban_groups', |
240 | 254 |
[ |
241 | 255 |
'name' => 'string-20', 'ban_time' => 'int', 'expire_time' => 'raw', 'cannot_access' => 'int', 'cannot_register' => 'int', |
... | ... |
@@ -246,8 +260,9 @@ class SFSB |
246 | 260 |
$ban_info['cannot']['post'], $ban_info['cannot']['login'], $ban_info['reason'], $ban_info['notes'], |
247 | 261 |
], |
248 | 262 |
['id_ban_group'], |
249 |
- 1 |
|
263 |
+ 1, |
|
250 | 264 |
); |
265 |
+ |
|
251 | 266 |
return $this->smcFunc['db_insert_id']('{db_prefix}ban_groups', 'id_ban_group'); |
252 | 267 |
} |
253 | 268 |
|
... | ... |
@@ -265,9 +280,10 @@ class SFSB |
265 | 280 |
private function doBanNewSpammer(string $ip_address): bool |
266 | 281 |
{ |
267 | 282 |
// SMF 2.1 has some easier to use logic. |
268 |
- if (function_exists('addTriggers')) |
|
283 |
+ if (function_exists('addTriggers')) { |
|
269 | 284 |
return $this->BanNewIPSMF21($ip_address); |
270 |
- else |
|
285 |
+ } |
|
286 |
+ |
|
271 | 287 |
return $this->BanNewIPSMF20($ip_address); |
272 | 288 |
} |
273 | 289 |
|
... | ... |
@@ -285,7 +301,9 @@ class SFSB |
285 | 301 |
private function BanNewIPSMF21(string $ip_address): bool |
286 | 302 |
{ |
287 | 303 |
// We don't call checkExistingTriggerIP as it induces a fatal error. |
288 |
- $request = $this->smcFunc['db_query']('', ' |
|
304 |
+ $request = $this->smcFunc['db_query']( |
|
305 |
+ '', |
|
306 |
+ ' |
|
289 | 307 |
SELECT bg.id_ban_group, bg.name |
290 | 308 |
FROM {db_prefix}ban_groups AS bg |
291 | 309 |
INNER JOIN {db_prefix}ban_items AS bi ON |
... | ... |
@@ -295,12 +313,13 @@ class SFSB |
295 | 313 |
[ |
296 | 314 |
'ip_low' => $ip_address, |
297 | 315 |
'ip_high' => $ip_address, |
298 |
- ] |
|
316 |
+ ], |
|
299 | 317 |
); |
318 |
+ |
|
300 | 319 |
// Alredy exists, bail out. |
301 |
- if ($this->smcFunc['db_num_rows']($request) != 0) |
|
302 |
- { |
|
320 |
+ if ($this->smcFunc['db_num_rows']($request) != 0) { |
|
303 | 321 |
$this->smcFunc['db_free_result']($request); |
322 |
+ |
|
304 | 323 |
return false; |
305 | 324 |
} |
306 | 325 |
|
... | ... |
@@ -309,7 +328,7 @@ class SFSB |
309 | 328 |
[ |
310 | 329 |
'ip_low' => $ip_address, |
311 | 330 |
'ip_high' => $ip_address, |
312 |
- ] |
|
331 |
+ ], |
|
313 | 332 |
]; |
314 | 333 |
|
315 | 334 |
// Add it. |
... | ... |
@@ -334,11 +353,14 @@ class SFSB |
334 | 353 |
$ip_parts = ip2range($ip_address); |
335 | 354 |
|
336 | 355 |
// Not valid? Get out. |
337 |
- if (count($ip_parts) != 4) |
|
356 |
+ if (count($ip_parts) != 4) { |
|
338 | 357 |
return false; |
358 |
+ } |
|
339 | 359 |
|
340 | 360 |
// We don't call checkExistingTriggerIP as it induces a fatal error. |
341 |
- $request = $this->smcFunc['db_query']('', ' |
|
361 |
+ $request = $this->smcFunc['db_query']( |
|
362 |
+ '', |
|
363 |
+ ' |
|
342 | 364 |
SELECT bg.id_ban_group, bg.name |
343 | 365 |
FROM {db_prefix}ban_groups AS bg |
344 | 366 |
INNER JOIN {db_prefix}ban_items AS bi ON |
... | ... |
@@ -357,12 +379,13 @@ class SFSB |
357 | 379 |
'ip_high3' => $ip_parts[2]['high'], |
358 | 380 |
'ip_low4' => $ip_parts[3]['low'], |
359 | 381 |
'ip_high4' => $ip_parts[3]['high'], |
360 |
- ] |
|
382 |
+ ], |
|
361 | 383 |
); |
384 |
+ |
|
362 | 385 |
// Alredy exists, bail out. |
363 |
- if ($this->smcFunc['db_num_rows']($request) != 0) |
|
364 |
- { |
|
386 |
+ if ($this->smcFunc['db_num_rows']($request) != 0) { |
|
365 | 387 |
$this->smcFunc['db_free_result']($request); |
388 |
+ |
|
366 | 389 |
return false; |
367 | 390 |
} |
368 | 391 |
|
... | ... |
@@ -381,7 +404,8 @@ class SFSB |
381 | 404 |
0, |
382 | 405 |
]]; |
383 | 406 |
|
384 |
- $this->smcFunc['db_insert']('', |
|
407 |
+ $this->smcFunc['db_insert']( |
|
408 |
+ '', |
|
385 | 409 |
'{db_prefix}ban_items', |
386 | 410 |
[ |
387 | 411 |
'id_ban_group' => 'int', 'ip_low1' => 'int', 'ip_high1' => 'int', 'ip_low2' => 'int', 'ip_high2' => 'int', |
... | ... |
@@ -389,7 +413,7 @@ class SFSB |
389 | 413 |
'email_address' => 'string-255', 'id_member' => 'int', |
390 | 414 |
], |
391 | 415 |
$ban_triggers, |
392 |
- ['id_ban'] |
|
416 |
+ ['id_ban'], |
|
393 | 417 |
); |
394 | 418 |
|
395 | 419 |
return true; |
... | ... |
@@ -28,7 +28,7 @@ class SFSL |
28 | 28 |
* @var mixed Search area handling. |
29 | 29 |
*/ |
30 | 30 |
private array $search_types = []; |
31 |
- private /*string|array*/ $search_params = []; |
|
31 |
+ /*string|array*/ private $search_params = []; |
|
32 | 32 |
private array $logSearch = []; |
33 | 33 |
private string $sort_order = 'time'; |
34 | 34 |
private string $search_params_column = ''; |
... | ... |
@@ -60,8 +60,9 @@ class SFSL |
60 | 60 |
*/ |
61 | 61 |
public static function selfClass(): self |
62 | 62 |
{ |
63 |
- if (!isset($GLOBALS['context']['instances'][__CLASS__])) |
|
63 |
+ if (!isset($GLOBALS['context']['instances'][__CLASS__])) { |
|
64 | 64 |
$GLOBALS['context']['instances'][__CLASS__] = new self(); |
65 |
+ } |
|
65 | 66 |
|
66 | 67 |
return $GLOBALS['context']['instances'][__CLASS__]; |
67 | 68 |
} |
... | ... |
@@ -73,13 +74,14 @@ class SFSL |
73 | 74 |
* @CalledIn SMF 2.0, SMF 2.1 |
74 | 75 |
* @version 1.5.0 |
75 | 76 |
* @since 1.2 |
76 |
- * @return void No return is generated |
|
77 | 77 |
*/ |
78 | 78 |
public function __construct() |
79 | 79 |
{ |
80 | 80 |
$this->scripturl = $GLOBALS['scripturl']; |
81 |
- foreach (['context', 'smcFunc', 'txt', 'modSettings'] as $f) |
|
81 |
+ |
|
82 |
+ foreach (['context', 'smcFunc', 'txt', 'modSettings'] as $f) { |
|
82 | 83 |
$this->{$f} = &$GLOBALS[$f]; |
84 |
+ } |
|
83 | 85 |
|
84 | 86 |
$this->SFSclass = &$this->smcFunc['classSFS']; |
85 | 87 |
$this->SFSAclass = SFSA::selfClass(); |
... | ... |
@@ -99,7 +101,6 @@ class SFSL |
99 | 101 |
* @version 1.5.0 |
100 | 102 |
* @since 1.0 |
101 | 103 |
* @uses integrate_manage_logs - Hook SMF2.1 |
102 |
- * @return void No return is generated |
|
103 | 104 |
*/ |
104 | 105 |
public static function hook_manage_logs(array &$log_functions): bool |
105 | 106 |
{ |
... | ... |
@@ -118,7 +119,6 @@ class SFSL |
118 | 119 |
* @See SFSA::startupLogs |
119 | 120 |
* @version 1.5.0 |
120 | 121 |
* @since 1.1 |
121 |
- * @return void No return is generated |
|
122 | 122 |
*/ |
123 | 123 |
public function AddToLogMenu(array &$log_functions): bool |
124 | 124 |
{ |
... | ... |
@@ -144,7 +144,6 @@ class SFSL |
144 | 144 |
* @since 1.0 |
145 | 145 |
* @uses hook_manage_logs - Hook SMF2.1 |
146 | 146 |
* @uses setupModifyModifications - Injected SMF2.0 |
147 |
- * @return void No return is generated |
|
148 | 147 |
*/ |
149 | 148 |
public static function startupLogs(bool $return_config = false): array |
150 | 149 |
{ |
... | ... |
@@ -165,13 +164,13 @@ class SFSL |
165 | 164 |
* @since 1.0 |
166 | 165 |
* @uses hook_manage_logs - Hook SMF2.1 |
167 | 166 |
* @uses setupModifyModifications - Injected SMF2.0 |
168 |
- * @return void No return is generated |
|
169 | 167 |
*/ |
170 | 168 |
public function loadLogs(bool $return_config = false): array |
171 | 169 |
{ |
172 | 170 |
// No Configs. |
173 |
- if ($return_config) |
|
171 |
+ if ($return_config) { |
|
174 | 172 |
return []; |
173 |
+ } |
|
175 | 174 |
|
176 | 175 |
$this->SFSclass->loadLanguage('Modlog'); |
177 | 176 |
|
... | ... |
@@ -181,8 +180,9 @@ class SFSL |
181 | 180 |
$this->canDeleteLogs = allowedTo('admin_forum'); |
182 | 181 |
|
183 | 182 |
// Remove all.. |
184 |
- if ((isset($_POST['removeall']) || isset($_POST['delete'])) && $this->canDeleteLogs) |
|
183 |
+ if ((isset($_POST['removeall']) || isset($_POST['delete'])) && $this->canDeleteLogs) { |
|
185 | 184 |
$this->handleLogDeletes(); |
185 |
+ } |
|
186 | 186 |
|
187 | 187 |
$sort_types = $this->handleLogsGetSortTypes(); |
188 | 188 |
|
... | ... |
@@ -250,7 +250,7 @@ class SFSL |
250 | 250 |
'token' => empty($token) ? null : 'sfs_logs', |
251 | 251 |
'hidden_fields' => [ |
252 | 252 |
$this->context['session_var'] => $this->context['session_id'], |
253 |
- 'params' => $this->search_params |
|
253 |
+ 'params' => $this->search_params, |
|
254 | 254 |
], |
255 | 255 |
], |
256 | 256 |
'additional_rows' => [ |
... | ... |
@@ -266,18 +266,18 @@ class SFSL |
266 | 266 |
* @CalledIn SMF2.0, SMF 2.1 |
267 | 267 |
* @version 1.5.0 |
268 | 268 |
* @since 1.1 |
269 |
- * @return void Nothing is returned, the logs are deleted as requested and admin redirected. |
|
270 | 269 |
*/ |
271 | 270 |
private function handleLogDeletes(): void |
272 | 271 |
{ |
273 | 272 |
checkSession(); |
274 | 273 |
$this->SFSclass->createToken('sfs_logs', 'post'); |
275 | 274 |
|
276 |
- if (isset($_POST['removeall']) && $this->canDeleteLogs) |
|
275 |
+ if (isset($_POST['removeall']) && $this->canDeleteLogs) { |
|
277 | 276 |
$this->removeAllLogs(); |
278 |
- elseif (!empty($_POST['remove']) && isset($_POST['delete']) && $this->canDeleteLogs) |
|
277 |
+ } elseif (!empty($_POST['remove']) && isset($_POST['delete']) && $this->canDeleteLogs) { |
|
279 | 278 |
$this->removeLogs(array_unique($_POST['delete'])); |
280 | 279 |
} |
280 |
+ } |
|
281 | 281 |
|
282 | 282 |
/** |
283 | 283 |
* loadLogs - Sort Types. |
... | ... |
@@ -618,8 +618,7 @@ class SFSL |
618 | 618 |
'value' => '<input type="checkbox" name="all" class="input_check" onclick="invertAll(this, this.form);" />', |
619 | 619 |
], |
620 | 620 |
'data' => [ |
621 |
- 'function' => function($entry) |
|
622 |
- { |
|
621 |
+ 'function' => function ($entry) { |
|
623 | 622 |
return '<input type="checkbox" class="input_check" name="delete[]" value="' . $entry['id'] . '"' . ($entry['editable'] ? '' : ' disabled="disabled"') . ' />'; |
624 | 623 |
}, |
625 | 624 |
'style' => 'text-align: center;', |
... | ... |
@@ -643,12 +642,13 @@ class SFSL |
643 | 642 |
* @since 1.0 |
644 | 643 |
* @uses hook_manage_logs - Hook SMF2.1 |
645 | 644 |
* @uses setupModifyModifications - Injected SMF2.0 |
646 |
- * @return void No return is generated |
|
647 | 645 |
*/ |
648 | 646 |
public function getSFSLogEntries(int $start, int $items_per_page, string $sort, string $query_string = '', array $query_params = []): array |
649 | 647 |
{ |
650 | 648 |
// Fetch all of our logs. |
651 |
- $result = $this->smcFunc['db_query']('', ' |
|
649 |
+ $result = $this->smcFunc['db_query']( |
|
650 |
+ '', |
|
651 |
+ ' |
|
652 | 652 |
SELECT |
653 | 653 |
l.id_sfs, l.id_type, l.log_time, l.url, l.id_member, l.username, l.email, l.ip, l.ip2, l.checks, l.result, |
654 | 654 |
mem.real_name, mg.group_name |
... | ... |
@@ -664,12 +664,14 @@ class SFSL |
664 | 664 |
'start' => $start, |
665 | 665 |
'items_per_page' => $items_per_page, |
666 | 666 |
'reg_group_id' => 0, |
667 |
- ]) |
|
667 |
+ ]), |
|
668 | 668 |
); |
669 | 669 |
|
670 | 670 |
$entries = []; |
671 |
- while ($row = $this->smcFunc['db_fetch_assoc']($result)) |
|
671 |
+ |
|
672 |
+ while ($row = $this->smcFunc['db_fetch_assoc']($result)) { |
|
672 | 673 |
$entries[$row['id_sfs']] = $this->getSFSLogPrepareEntry($row); |
674 |
+ } |
|
673 | 675 |
$this->smcFunc['db_free_result']($result); |
674 | 676 |
|
675 | 677 |
return $entries; |
... | ... |
@@ -728,20 +730,23 @@ class SFSL |
728 | 730 |
$checksDecoded = $this->SFSclass->decodeJSON($row['checks']); |
729 | 731 |
|
730 | 732 |
// If we know what check triggered this, link it up to be searched. |
731 |
- if ($row['id_type'] == 1) |
|
733 |
+ if ($row['id_type'] == 1) { |
|
732 | 734 |
$checks = '<a href="' . sprintf($this->urlSFSsearch, $checksDecoded['value']) . '">' . $checksDecoded['value'] . '</a>'; |
733 |
- elseif ($row['id_type'] == 2) |
|
735 |
+ } elseif ($row['id_type'] == 2) { |
|
734 | 736 |
$checks = '<a href="' . sprintf($this->urlSFSsearch, $checksDecoded['value']) . '">' . $checksDecoded['value'] . '</a>'; |
735 |
- elseif ($row['id_type'] == 3) |
|
737 |
+ } elseif ($row['id_type'] == 3) { |
|
736 | 738 |
$checks = '<a href="' . sprintf($this->urlSFSsearch, $checksDecoded['value']) . '">' . $checksDecoded['value'] . '</a>'; |
739 |
+ } |
|
737 | 740 |
// No idea what triggered it, parse it out cleanly. Could be debug data as well. |
738 |
- else |
|
739 |
- { |
|
741 |
+ else { |
|
740 | 742 |
$checks = ''; |
741 |
- foreach ($checksDecoded as $ckey => $vkey) |
|
742 |
- foreach ($vkey as $key => $value) |
|
743 |
+ |
|
744 |
+ foreach ($checksDecoded as $ckey => $vkey) { |
|
745 |
+ foreach ($vkey as $key => $value) { |
|
743 | 746 |
$checks .= ucfirst($key) . ':' . $value . '<br>'; |
744 | 747 |
} |
748 |
+ } |
|
749 |
+ } |
|
745 | 750 |
|
746 | 751 |
return $checks; |
747 | 752 |
} |
... | ... |
@@ -761,20 +766,22 @@ class SFSL |
761 | 766 |
public function getSFSLogPrepareEntryResult(array $row = []): string |
762 | 767 |
{ |
763 | 768 |
// This tells us what it matched on exactly. |
764 |
- if (strpos($row['result'], ',') === false) |
|
769 |
+ if (strpos($row['result'], ',') === false) { |
|
765 | 770 |
return $row['result']; |
771 |
+ } |
|
766 | 772 |
|
767 | 773 |
$results = []; |
768 |
- foreach (array_filter(explode('|', $row['result'] . '|'), function ($match) {return !empty($match);}) as $match) |
|
769 |
- { |
|
774 |
+ |
|
775 |
+ foreach (array_filter(explode('|', $row['result'] . '|'), function ($match) {return !empty($match);}) as $match) { |
|
770 | 776 |
list($resultType, $resultMatch, $extra) = explode(',', $match . ',,,'); |
771 | 777 |
$res = sprintf($this->SFSclass->txt('sfs_log_matched_on'), $resultType, $resultMatch); |
772 | 778 |
|
773 | 779 |
// If this was a IP ban, note it. |
774 |
- if ($resultType == 'ip' && !empty($extra)) |
|
780 |
+ if ($resultType == 'ip' && !empty($extra)) { |
|
775 | 781 |
$res .= ' ' . $this->SFSclass->txt('sfs_log_auto_banned'); |
776 |
- elseif ($resultType == 'username' && !empty($extra)) |
|
782 |
+ } elseif ($resultType == 'username' && !empty($extra)) { |
|
777 | 783 |
$res .= ' ' . sprintf($this->SFSclass->txt('sfs_log_confidence'), $extra); |
784 |
+ } |
|
778 | 785 |
|
779 | 786 |
$results[] = $res; |
780 | 787 |
} |
... | ... |
@@ -795,11 +802,12 @@ class SFSL |
795 | 802 |
* @since 1.0 |
796 | 803 |
* @uses hook_manage_logs - Hook SMF2.1 |
797 | 804 |
* @uses setupModifyModifications - Injected SMF2.0 |
798 |
- * @return void No return is generated |
|
799 | 805 |
*/ |
800 | 806 |
public function getSFSLogEntriesCount(string $query_string = '', array $query_params = []): int |
801 | 807 |
{ |
802 |
- $result = $this->smcFunc['db_query']('', ' |
|
808 |
+ $result = $this->smcFunc['db_query']( |
|
809 |
+ '', |
|
810 |
+ ' |
|
803 | 811 |
SELECT COUNT(*) |
804 | 812 |
FROM {db_prefix}log_sfs AS l |
805 | 813 |
LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = l.id_member) |
... | ... |
@@ -809,7 +817,7 @@ class SFSL |
809 | 817 |
AND ' . $query_string : ''), |
810 | 818 |
array_merge($query_params, [ |
811 | 819 |
'reg_group_id' => 0, |
812 |
- ]) |
|
820 |
+ ]), |
|
813 | 821 |
); |
814 | 822 |
list($entry_count) = $this->smcFunc['db_fetch_row']($result); |
815 | 823 |
$this->smcFunc['db_free_result']($result); |
... | ... |
@@ -828,13 +836,14 @@ class SFSL |
828 | 836 |
*/ |
829 | 837 |
private function getBaseUrl(): string |
830 | 838 |
{ |
831 |
- if (empty($this->adminLogURL)) |
|
832 |
- { |
|
833 |
- if ($this->SFSclass->versionCheck('2.0', 'smf')) |
|
839 |
+ if (empty($this->adminLogURL)) { |
|
840 |
+ if ($this->SFSclass->versionCheck('2.0', 'smf')) { |
|
834 | 841 |
$this->adminLogURL = $this->scripturl . '?action=admin;area=modsettings;sa=sfslog'; |
835 |
- else |
|
842 |
+ } else { |
|
836 | 843 |
$this->adminLogURL = $this->scripturl . '?action=admin;area=logs;sa=sfslog'; |
837 | 844 |
} |
845 |
+ } |
|
846 |
+ |
|
838 | 847 |
return $this->adminLogURL; |
839 | 848 |
} |
840 | 849 |
|
... | ... |
@@ -846,16 +855,17 @@ class SFSL |
846 | 855 |
* @See SFSA::loadLogs |
847 | 856 |
* @version 1.5.0 |
848 | 857 |
* @since 1.0 |
849 |
- * @return void No return is generated |
|
850 | 858 |
*/ |
851 | 859 |
private function removeAllLogs(): void |
852 | 860 |
{ |
853 |
- $this->smcFunc['db_query']('', ' |
|
861 |
+ $this->smcFunc['db_query']( |
|
862 |
+ '', |
|
863 |
+ ' |
|
854 | 864 |
DELETE FROM {db_prefix}log_sfs |
855 | 865 |
WHERE log_time < {int:twenty_four_hours_wait}', |
856 | 866 |
[ |
857 | 867 |
'twenty_four_hours_wait' => time() - $this->hoursDisabled * 3600, |
858 |
- ] |
|
868 |
+ ], |
|
859 | 869 |
); |
860 | 870 |
} |
861 | 871 |
|
... | ... |
@@ -869,18 +879,19 @@ class SFSL |
869 | 879 |
* @See SFSA::loadLogs |
870 | 880 |
* @version 1.5.0 |
871 | 881 |
* @since 1.0 |
872 |
- * @return void No return is generated |
|
873 | 882 |
*/ |
874 | 883 |
private function removeLogs(array $entries): void |
875 | 884 |
{ |
876 |
- $this->smcFunc['db_query']('', ' |
|
885 |
+ $this->smcFunc['db_query']( |
|
886 |
+ '', |
|
887 |
+ ' |
|
877 | 888 |
DELETE FROM {db_prefix}log_sfs |
878 | 889 |
WHERE id_sfs IN ({array_string:delete_actions}) |
879 | 890 |
AND log_time < {int:twenty_four_hours_wait}', |
880 | 891 |
[ |
881 | 892 |
'twenty_four_hours_wait' => time() - $this->hoursDisabled * 3600, |
882 | 893 |
'delete_actions' => $entries, |
883 |
- ] |
|
894 |
+ ], |
|
884 | 895 |
); |
885 | 896 |
} |
886 | 897 |
|
... | ... |
@@ -892,7 +903,6 @@ class SFSL |
892 | 903 |
* @CalledIn SMF 2.0, SMF 2.1 |
893 | 904 |
* @version 1.5.0 |
894 | 905 |
* @since 1.0 |
895 |
- * @return void No return is generated here. |
|
896 | 906 |
*/ |
897 | 907 |
private function handleLogSearch(string &$url): void |
898 | 908 |
{ |
... | ... |
@@ -917,9 +927,10 @@ class SFSL |
917 | 927 |
'label' => $this->search_types[$this->search_params_type]['label'], |
918 | 928 |
]; |
919 | 929 |
|
920 |
- if (!empty($this->search_params)) |
|
930 |
+ if (!empty($this->search_params)) { |
|
921 | 931 |
$url .= ';params=' . $this->search_params; |
922 | 932 |
} |
933 |
+ } |
|
923 | 934 |
|
924 | 935 |
/** |
925 | 936 |
* Handle Search Params |
... | ... |
@@ -933,14 +944,14 @@ class SFSL |
933 | 944 |
private function handleLogSearchParams(): array |
934 | 945 |
{ |
935 | 946 |
// If we have something to search for saved, get it back out. |
936 |
- if (!empty($_REQUEST['params']) && empty($_REQUEST['is_search'])) |
|
937 |
- { |
|
947 |
+ if (!empty($_REQUEST['params']) && empty($_REQUEST['is_search'])) { |
|
938 | 948 |
$search_params = base64_decode(strtr($_REQUEST['params'], [' ' => '+'])); |
939 | 949 |
$search_params = $this->SFSclass->decodeJSON($search_params); |
940 | 950 |
|
941 |
- if (!empty($search_params)) |
|
951 |
+ if (!empty($search_params)) { |
|
942 | 952 |
return $search_params; |
943 | 953 |
} |
954 |
+ } |
|
944 | 955 |
|
945 | 956 |
return []; |
946 | 957 |
} |
... | ... |
@@ -962,7 +973,7 @@ class SFSL |
962 | 973 |
'username' => ['sql' => 'l.username', 'label' => $this->SFSclass->txt('sfs_log_search_username')], |
963 | 974 |
'email' => ['sql' => 'l.email', 'label' => $this->SFSclass->txt('sfs_log_search_email')], |
964 | 975 |
'ip' => ['sql' => 'lm.ip', 'label' => $this->SFSclass->txt('sfs_log_search_ip')], |
965 |
- 'ip2' => ['sql' => 'lm.ip2', 'label' => $this->SFSclass->txt('sfs_log_search_ip2')] |
|
976 |
+ 'ip2' => ['sql' => 'lm.ip2', 'label' => $this->SFSclass->txt('sfs_log_search_ip2')], |
|
966 | 977 |
]; |
967 | 978 |
} |
968 | 979 |
|
... | ... |
@@ -977,11 +988,14 @@ class SFSL |
977 | 988 |
*/ |
978 | 989 |
private function handleLogSearchParamsString(): string |
979 | 990 |
{ |
980 |
- if (!empty($_REQUEST['search']) && ($this->search_params['string'] ?? '') != $_REQUEST['search']) |
|
991 |
+ if (!empty($_REQUEST['search']) && ($this->search_params['string'] ?? '') != $_REQUEST['search']) { |
|
981 | 992 |
return (string) $_REQUEST['search']; |
982 |
- elseif (isset($this->search_params['string'])) |
|
993 |
+ } |
|
994 |
+ |
|
995 |
+ if (isset($this->search_params['string'])) { |
|
983 | 996 |
return $this->search_params['string']; |
984 |
- else |
|
997 |
+ } |
|
998 |
+ |
|
985 | 999 |
return ''; |
986 | 1000 |
} |
987 | 1001 |
|
... | ... |
@@ -996,13 +1010,18 @@ class SFSL |
996 | 1010 |
*/ |
997 | 1011 |
private function handleLogSearchParamsType(): string |
998 | 1012 |
{ |
999 |
- if (isset($_REQUEST['search_type']) && isset($this->search_types[$_REQUEST['search_type']])) |
|
1013 |
+ if (isset($_REQUEST['search_type'], $this->search_types[$_REQUEST['search_type']])) { |
|
1000 | 1014 |
return (string) $_REQUEST['search_type']; |
1001 |
- elseif (!empty($this->search_params['type']) && isset($this->search_types[$this->search_params['type']])) |
|
1015 |
+ } |
|
1016 |
+ |
|
1017 |
+ if (!empty($this->search_params['type']) && isset($this->search_types[$this->search_params['type']])) { |
|
1002 | 1018 |
return $this->search_params['type']; |
1003 |
- elseif (isset($this->search_types[$this->sort_order])) |
|
1019 |
+ } |
|
1020 |
+ |
|
1021 |
+ if (isset($this->search_types[$this->sort_order])) { |
|
1004 | 1022 |
return $this->sort_order; |
1005 |
- else |
|
1023 |
+ } |
|
1024 |
+ |
|
1006 | 1025 |
return 'member'; |
1007 | 1026 |
} |
1008 | 1027 |
} |
... | ... |
@@ -35,8 +35,9 @@ class SFSP |
35 | 35 |
*/ |
36 | 36 |
public static function selfClass(): self |
37 | 37 |
{ |
38 |
- if (!isset($GLOBALS['context']['instances'][__CLASS__])) |
|
38 |
+ if (!isset($GLOBALS['context']['instances'][__CLASS__])) { |
|
39 | 39 |
$GLOBALS['context']['instances'][__CLASS__] = new self(); |
40 |
+ } |
|
40 | 41 |
|
41 | 42 |
return $GLOBALS['context']['instances'][__CLASS__]; |
42 | 43 |
} |
... | ... |
@@ -48,13 +49,14 @@ class SFSP |
48 | 49 |
* @CalledIn SMF 2.0, SMF 2.1 |
49 | 50 |
* @version 1.5.0 |
50 | 51 |
* @since 1.0 |
51 |
- * @return void No return is generated |
|
52 | 52 |
*/ |
53 | 53 |
public function __construct() |
54 | 54 |
{ |
55 | 55 |
$this->scripturl = $GLOBALS['scripturl']; |
56 |
- foreach (['context', 'smcFunc', 'txt', 'modSettings', 'user_info'] as $f) |
|
56 |
+ |
|
57 |
+ foreach (['context', 'smcFunc', 'txt', 'modSettings', 'user_info'] as $f) { |
|
57 | 58 |
$this->{$f} = &$GLOBALS[$f]; |
59 |
+ } |
|
58 | 60 |
|
59 | 61 |
$this->SFSclass = &$this->smcFunc['classSFS']; |
60 | 62 |
} |
... | ... |
@@ -70,7 +72,6 @@ class SFSP |
70 | 72 |
* @version 1.1 |
71 | 73 |
* @since 1.1 |
72 | 74 |
* @uses integrate_pre_profile_areas - Hook SMF2.1 |
73 |
- * @return void the passed $profile_areas is modified. |
|
74 | 75 |
*/ |
75 | 76 |
public static function hook_pre_profile_areas(array &$profile_areas): void |
76 | 77 |
{ |
... | ... |
@@ -87,7 +88,6 @@ class SFSP |
87 | 88 |
* @version 1.5.0 |
88 | 89 |
* @since 1.1 |
89 | 90 |
* @uses integrate_pre_profile_areas - Hook SMF2.1 |
90 |
- * @return void the passed $profile_areas is modified. |
|
91 | 91 |
*/ |
92 | 92 |
public function setupProfileMenu(array &$profile_areas): void |
93 | 93 |
{ |
... | ... |
@@ -103,8 +103,7 @@ class SFSP |
103 | 103 |
]; |
104 | 104 |
|
105 | 105 |
// SMF 2.0 can't call objects or classes. |
106 |
- if ($this->SFSclass->versionCheck('2.0', 'smf')) |
|
107 |
- { |
|
106 |
+ if ($this->SFSclass->versionCheck('2.0', 'smf')) { |
|
108 | 107 |
function ProfileTrackSFS20(int $memID) |
109 | 108 |
{ |
110 | 109 |
SFSP::ProfileTrackSFS($memID); |
... | ... |
@@ -122,7 +121,6 @@ class SFSP |
122 | 121 |
* @CalledIn SMF 2.1 |
123 | 122 |
* @version 1.1 |
124 | 123 |
* @since 1.1 |
125 |
- * @return void the passed $profile_areas is modified. |
|
126 | 124 |
*/ |
127 | 125 |
public static function ProfileTrackSFS(int $memID): void |
128 | 126 |
{ |
... | ... |
@@ -139,7 +137,6 @@ class SFSP |
139 | 137 |
* @version 1.5.0 |
140 | 138 |
* @since 1.1 |
141 | 139 |
* @uses integrate_pre_profile_areas - Hook SMF2.1 |
142 |
- * @return void the passed $profile_areas is modified. |
|
143 | 140 |
*/ |
144 | 141 |
public function loadUser(int $memID): void |
145 | 142 |
{ |
... | ... |
@@ -156,7 +153,6 @@ class SFSP |
156 | 153 |
* @CalledIn SMF 2.1 |
157 | 154 |
* @version 1.5.0 |
158 | 155 |
* @since 1.1 |
159 |
- * @return void the passed $profile_areas is modified. |
|
160 | 156 |
*/ |
161 | 157 |
public function TrackSFS(int $memID): void |
162 | 158 |
{ |
... | ... |
@@ -170,8 +166,7 @@ class SFSP |
170 | 166 |
$cache_key = 'sfs_check_member-' . $this->memID; |
171 | 167 |
|
172 | 168 |
// Do we have a message? |
173 |
- if (isset($_GET['msg']) && intval($_GET['msg']) > 0) |
|
174 |
- { |
|
169 |
+ if (isset($_GET['msg']) && intval($_GET['msg']) > 0) { |
|
175 | 170 |
$row = $this->TrackSFSMessage((int) $_GET['msg']); |
176 | 171 |
$cache_key .= '-msg' . ((int) $_GET['msg']); |
177 | 172 |
} |
... | ... |
@@ -179,8 +174,7 @@ class SFSP |
179 | 174 |
$this->context['reason'] = $this->smcFunc['htmlspecialchars']($row['post_body'] ?? ''); |
180 | 175 |
|
181 | 176 |
// Are we submitting this? |
182 |
- if ($this->context['sfs_allow_submit'] && (isset($_POST['sfs_submit']) || isset($_POST['sfs_submitban']))) |
|
183 |
- { |
|
177 |
+ if ($this->context['sfs_allow_submit'] && (isset($_POST['sfs_submit']) || isset($_POST['sfs_submitban']))) { |
|
184 | 178 |
checkSession(); |
185 | 179 |
$this->SFSclass->validateToken($this->context['token_check'], 'post'); |
186 | 180 |
|
... | ... |
@@ -188,14 +182,13 @@ class SFSP |
188 | 182 |
'username' => $row['poster_name'] ?? $this->user_profile['real_name'], |
189 | 183 |
'email' => $row['poster_email'] ?? $this->user_profile['email_address'], |
190 | 184 |
'ip_addr' => $row['poster_ip'] ?? $this->user_profile['member_ip'], |
191 |
- 'api_key' => $this->modSettings['sfs_apikey'] |
|
185 |
+ 'api_key' => $this->modSettings['sfs_apikey'], |
|
192 | 186 |
]; |
193 | 187 |
$this->TrackSFSSubmit($data); |
194 | 188 |
} |
195 | 189 |
|
196 | 190 |
// Check if we have this info. |
197 |
- if (($cache = cache_get_data($cache_key)) === null || ($response = $this->SFSclass->decodeJSON((string) $cache)) === null) |
|
198 |
- { |
|
191 |
+ if (($cache = cache_get_data($cache_key)) === null || ($response = $this->SFSclass->decodeJSON((string) $cache)) === null) { |
|
199 | 192 |
$checks = [ |
200 | 193 |
['username' => $row['poster_name'] ?? $this->user_profile['real_name']], |
201 | 194 |
['email' => $row['poster_email'] ?? $this->user_profile['email_address']], |
... | ... |
@@ -212,12 +205,13 @@ class SFSP |
212 | 205 |
$this->context['sfs_checks'] = $response; |
213 | 206 |
unset($this->context['sfs_checks']['success']); |
214 | 207 |
|
215 |
- if ($this->context['sfs_allow_submit']) |
|
216 |
- { |
|
208 |
+ if ($this->context['sfs_allow_submit']) { |
|
217 | 209 |
$this->context['sfs_submit_url'] = $this->scripturl . '?action=profile;area=sfs;u=' . $memID; |
218 |
- if (is_null($this->SFSclass->createToken($this->context['token_check'], 'post'))) |
|
210 |
+ |
|
211 |
+ if (is_null($this->SFSclass->createToken($this->context['token_check'], 'post'))) { |
|
219 | 212 |
unset($this->context['token_check']); |
220 | 213 |
} |
214 |
+ } |
|
221 | 215 |
|
222 | 216 |
$this->SFSclass->loadTemplate('StopForumSpam'); |
223 | 217 |
$this->context['sub_template'] = 'profile_tracksfs'; |
... | ... |
@@ -236,7 +230,9 @@ class SFSP |
236 | 230 |
{ |
237 | 231 |
$row = null; |
238 | 232 |
|
239 |
- $request = $this->smcFunc['db_query']('', ' |
|
233 |
+ $request = $this->smcFunc['db_query']( |
|
234 |
+ '', |
|
235 |
+ ' |
|
240 | 236 |
SELECT poster_name, poster_email, poster_ip, body |
241 | 237 |
FROM {db_prefix}messages |
242 | 238 |
WHERE id_msg = {int:id_msg} |
... | ... |
@@ -249,10 +245,11 @@ class SFSP |
249 | 245 |
[ |
250 | 246 |
'id_msg' => $id_msg, |
251 | 247 |
'id_member' => $this->memID, |
252 |
- 'actor_is_admin' => $this->context['user']['is_admin'] ? 1 : 0 |
|
253 |
- ]); |
|
254 |
- if ($this->smcFunc['db_num_rows']($request) == 1) |
|
255 |
- { |
|
248 |
+ 'actor_is_admin' => $this->context['user']['is_admin'] ? 1 : 0, |
|
249 |
+ ], |
|
250 |
+ ); |
|
251 |
+ |
|
252 |
+ if ($this->smcFunc['db_num_rows']($request) == 1) { |
|
256 | 253 |
$row = $this->smcFunc['db_fetch_assoc']($request); |
257 | 254 |
$row['poster_ip'] = inet_dtop($row['poster_ip']); |
258 | 255 |
} |
... | ... |
@@ -275,17 +272,19 @@ class SFSP |
275 | 272 |
$post_data = http_build_query($data, '', '&'); |
276 | 273 |
|
277 | 274 |
// SMF 2.0 has the fetch_web_data in the Subs-Packages, 2.1 it is in Subs.php. |
278 |
- if ($this->SFSclass->versionCheck('2.0', 'smf')) |
|
275 |
+ if ($this->SFSclass->versionCheck('2.0', 'smf')) { |
|
279 | 276 |
$this->SFSclass->loadSources('Subs-Package'); |
277 |
+ } |
|
280 | 278 |
|
281 | 279 |
// Now we have a URL, lets go get it. |
282 | 280 |
$result = fetch_web_data('https://www.stopforumspam.com/add', $post_data); |
283 | 281 |
|
284 |
- if ($result === false || strpos($result, 'data submitted successfully') === false) |
|
282 |
+ if ($result === false || strpos($result, 'data submitted successfully') === false) { |
|
285 | 283 |
$this->context['submission_failed'] = $this->SFSclass->txt('sfs_submission_error'); |
286 |
- elseif (isset($_POST['sfs_submitban'])) |
|
284 |
+ } elseif (isset($_POST['sfs_submitban'])) { |
|
287 | 285 |
redirectexit($this->scripturl . '?action=admin;area=ban;sa=add;u=' . $this->memID); |
288 |
- else |
|
286 |
+ } else { |
|
289 | 287 |
$this->context['submission_success'] = $this->SFSclass->txt('sfs_submission_success'); |
290 | 288 |
} |
291 | 289 |
} |
290 |
+} |
... | ... |
@@ -0,0 +1,19 @@ |
1 |
+{ |
|
2 |
+ "name": "jdarwood007/smfmod_sfs", |
|
3 |
+ "description": "Stop Forum Spam API support for SMF.", |
|
4 |
+ "type": "smf-mod", |
|
5 |
+ "require-dev": { |
|
6 |
+ "friendsofphp/php-cs-fixer": "dev-master" |
|
7 |
+ }, |
|
8 |
+ "license": "BSD 3-Clause License", |
|
9 |
+ "authors": [ |
|
10 |
+ { |
|
11 |
+ "name": "jdarwood007" |
|
12 |
+ } |
|
13 |
+ ], |
|
14 |
+ "scripts": { |
|
15 |
+ "lint": "php-cs-fixer check --diff --config .php-cs-fixer.dist.php --path-mode=intersection $(git diff --name-only \"*.php\")", |
|
16 |
+ "lint-fix": "php-cs-fixer fix -v --config .php-cs-fixer.dist.php --path-mode=intersection $(git diff --name-only \"*.php\")" |
|
17 |
+ }, |
|
18 |
+ "minimum-stability": "dev" |
|
19 |
+} |
... | ... |
@@ -0,0 +1,1844 @@ |
1 |
+{ |
|
2 |
+ "_readme": [ |
|
3 |
+ "This file locks the dependencies of your project to a known state", |
|
4 |
+ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", |
|
5 |
+ "This file is @generated automatically" |
|
6 |
+ ], |
|
7 |
+ "content-hash": "2a2ce55bb8f0f60c1ae4a3749925bb8a", |
|
8 |
+ "packages": [ |
|
9 |
+ { |
|
10 |
+ "name": "composer/pcre", |
|
11 |
+ "version": "dev-main", |
|
12 |
+ "source": { |
|
13 |
+ "type": "git", |
|
14 |
+ "url": "https://github.com/composer/pcre.git", |
|
15 |
+ "reference": "00104306927c7a0919b4ced2aaa6782c1e61a3c9" |
|
16 |
+ }, |
|
17 |
+ "dist": { |
|
18 |
+ "type": "zip", |
|
19 |
+ "url": "https://api.github.com/repos/composer/pcre/zipball/00104306927c7a0919b4ced2aaa6782c1e61a3c9", |
|
20 |
+ "reference": "00104306927c7a0919b4ced2aaa6782c1e61a3c9", |
|
21 |
+ "shasum": "" |
|
22 |
+ }, |
|
23 |
+ "require": { |
|
24 |
+ "php": "^7.4 || ^8.0" |
|
25 |
+ }, |
|
26 |
+ "require-dev": { |
|
27 |
+ "phpstan/phpstan": "^1.3", |
|
28 |
+ "phpstan/phpstan-strict-rules": "^1.1", |
|
29 |
+ "symfony/phpunit-bridge": "^5" |
|
30 |
+ }, |
|
31 |
+ "default-branch": true, |
|
32 |
+ "type": "library", |
|
33 |
+ "extra": { |
|
34 |
+ "branch-alias": { |
|
35 |
+ "dev-main": "3.x-dev" |
|
36 |
+ } |
|
37 |
+ }, |
|
38 |
+ "autoload": { |
|
39 |
+ "psr-4": { |
|
40 |
+ "Composer\\Pcre\\": "src" |
|
41 |
+ } |
|
42 |
+ }, |
|
43 |
+ "notification-url": "https://packagist.org/downloads/", |
|
44 |
+ "license": [ |
|
45 |
+ "MIT" |
|
46 |
+ ], |
|
47 |
+ "authors": [ |
|
48 |
+ { |
|
49 |
+ "name": "Jordi Boggiano", |
|
50 |
+ "email": "j.boggiano@seld.be", |
|
51 |
+ "homepage": "http://seld.be" |
|
52 |
+ } |
|
53 |
+ ], |
|
54 |
+ "description": "PCRE wrapping library that offers type-safe preg_* replacements.", |
|
55 |
+ "keywords": [ |
|
56 |
+ "PCRE", |
|
57 |
+ "preg", |
|
58 |
+ "regex", |
|
59 |
+ "regular expression" |
|
60 |
+ ], |
|
61 |
+ "support": { |
|
62 |
+ "issues": "https://github.com/composer/pcre/issues", |
|
63 |
+ "source": "https://github.com/composer/pcre/tree/3.1.1" |
|
64 |
+ }, |
|
65 |
+ "funding": [ |
|
66 |
+ { |
|
67 |
+ "url": "https://packagist.com", |
|
68 |
+ "type": "custom" |
|
69 |
+ }, |
|
70 |
+ { |
|
71 |
+ "url": "https://github.com/composer", |
|
72 |
+ "type": "github" |
|
73 |
+ }, |
|
74 |
+ { |
|
75 |
+ "url": "https://tidelift.com/funding/github/packagist/composer/composer", |
|
76 |
+ "type": "tidelift" |
|
77 |
+ } |
|
78 |
+ ], |
|
79 |
+ "time": "2023-10-11T07:11:09+00:00" |
|
80 |
+ }, |
|
81 |
+ { |
|
82 |
+ "name": "composer/semver", |
|
83 |
+ "version": "dev-main", |
|
84 |
+ "source": { |
|
85 |
+ "type": "git", |
|
86 |
+ "url": "https://github.com/composer/semver.git", |
|
87 |
+ "reference": "1d09200268e7d1052ded8e5da9c73c96a63d18f5" |
|
88 |
+ }, |
|
89 |
+ "dist": { |
|
90 |
+ "type": "zip", |
|
91 |
+ "url": "https://api.github.com/repos/composer/semver/zipball/1d09200268e7d1052ded8e5da9c73c96a63d18f5", |
|
92 |
+ "reference": "1d09200268e7d1052ded8e5da9c73c96a63d18f5", |
|
93 |
+ "shasum": "" |
|
94 |
+ }, |
|
95 |
+ "require": { |
|
96 |
+ "php": "^5.3.2 || ^7.0 || ^8.0" |
|
97 |
+ }, |
|
98 |
+ "require-dev": { |
|
99 |
+ "phpstan/phpstan": "^1.4", |
|
100 |
+ "symfony/phpunit-bridge": "^4.2 || ^5" |
|
101 |
+ }, |
|
102 |
+ "default-branch": true, |
|
103 |
+ "type": "library", |
|
104 |
+ "extra": { |
|
105 |
+ "branch-alias": { |
|
106 |
+ "dev-main": "3.x-dev" |
|
107 |
+ } |
|
108 |
+ }, |
|
109 |
+ "autoload": { |
|
110 |
+ "psr-4": { |
|
111 |
+ "Composer\\Semver\\": "src" |
|
112 |
+ } |
|
113 |
+ }, |
|
114 |
+ "notification-url": "https://packagist.org/downloads/", |
|
115 |
+ "license": [ |
|
116 |
+ "MIT" |
|
117 |
+ ], |
|
118 |
+ "authors": [ |
|
119 |
+ { |
|
120 |
+ "name": "Nils Adermann", |
|
121 |
+ "email": "naderman@naderman.de", |
|
122 |
+ "homepage": "http://www.naderman.de" |
|
123 |
+ }, |
|
124 |
+ { |
|
125 |
+ "name": "Jordi Boggiano", |
|
126 |
+ "email": "j.boggiano@seld.be", |
|
127 |
+ "homepage": "http://seld.be" |
|
128 |
+ }, |
|
129 |
+ { |
|
130 |
+ "name": "Rob Bast", |
|
131 |
+ "email": "rob.bast@gmail.com", |
|
132 |
+ "homepage": "http://robbast.nl" |
|
133 |
+ } |
|
134 |
+ ], |
|
135 |
+ "description": "Semver library that offers utilities, version constraint parsing and validation.", |
|
136 |
+ "keywords": [ |
|
137 |
+ "semantic", |
|
138 |
+ "semver", |
|
139 |
+ "validation", |
|
140 |
+ "versioning" |
|
141 |
+ ], |
|
142 |
+ "support": { |
|
143 |
+ "irc": "ircs://irc.libera.chat:6697/composer", |
|
144 |
+ "issues": "https://github.com/composer/semver/issues", |
|
145 |
+ "source": "https://github.com/composer/semver/tree/main" |
|
146 |
+ }, |
|
147 |
+ "funding": [ |
|
148 |
+ { |
|
149 |
+ "url": "https://packagist.com", |
|
150 |
+ "type": "custom" |
|
151 |
+ }, |
|
152 |
+ { |
|
153 |
+ "url": "https://github.com/composer", |
|
154 |
+ "type": "github" |
|
155 |
+ }, |
|
156 |
+ { |
|
157 |
+ "url": "https://tidelift.com/funding/github/packagist/composer/composer", |
|
158 |
+ "type": "tidelift" |
|
159 |
+ } |
|
160 |
+ ], |
|
161 |
+ "time": "2023-08-31T12:20:31+00:00" |
|
162 |
+ }, |
|
163 |
+ { |
|
164 |
+ "name": "composer/xdebug-handler", |
|
165 |
+ "version": "3.0.3", |
|
166 |
+ "source": { |
|
167 |
+ "type": "git", |
|
168 |
+ "url": "https://github.com/composer/xdebug-handler.git", |
|
169 |
+ "reference": "ced299686f41dce890debac69273b47ffe98a40c" |
|
170 |
+ }, |
|
171 |
+ "dist": { |
|
172 |
+ "type": "zip", |
|
173 |
+ "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/ced299686f41dce890debac69273b47ffe98a40c", |
|
174 |
+ "reference": "ced299686f41dce890debac69273b47ffe98a40c", |
|
175 |
+ "shasum": "" |
|
176 |
+ }, |
|
177 |
+ "require": { |
|
178 |
+ "composer/pcre": "^1 || ^2 || ^3", |
|
179 |
+ "php": "^7.2.5 || ^8.0", |
|
180 |
+ "psr/log": "^1 || ^2 || ^3" |
|
181 |
+ }, |
|
182 |
+ "require-dev": { |
|
183 |
+ "phpstan/phpstan": "^1.0", |
|
184 |
+ "phpstan/phpstan-strict-rules": "^1.1", |
|
185 |
+ "symfony/phpunit-bridge": "^6.0" |
|
186 |
+ }, |
|
187 |
+ "type": "library", |
|
188 |
+ "autoload": { |
|
189 |
+ "psr-4": { |
|
190 |
+ "Composer\\XdebugHandler\\": "src" |
|
191 |
+ } |
|
192 |
+ }, |
|
193 |
+ "notification-url": "https://packagist.org/downloads/", |
|
194 |
+ "license": [ |
|
195 |
+ "MIT" |
|
196 |
+ ], |
|
197 |
+ "authors": [ |
|
198 |
+ { |
|
199 |
+ "name": "John Stevenson", |
|
200 |
+ "email": "john-stevenson@blueyonder.co.uk" |
|
201 |
+ } |
|
202 |
+ ], |
|
203 |
+ "description": "Restarts a process without Xdebug.", |
|
204 |
+ "keywords": [ |
|
205 |
+ "Xdebug", |
|
206 |
+ "performance" |
|
207 |
+ ], |
|
208 |
+ "support": { |
|
209 |
+ "irc": "irc://irc.freenode.org/composer", |
|
210 |
+ "issues": "https://github.com/composer/xdebug-handler/issues", |
|
211 |
+ "source": "https://github.com/composer/xdebug-handler/tree/3.0.3" |
|
212 |
+ }, |
|
213 |
+ "funding": [ |
|
214 |
+ { |
|
215 |
+ "url": "https://packagist.com", |
|
216 |
+ "type": "custom" |
|
217 |
+ }, |
|
218 |
+ { |
|
219 |
+ "url": "https://github.com/composer", |
|
220 |
+ "type": "github" |
|
221 |
+ }, |
|
222 |
+ { |
|
223 |
+ "url": "https://tidelift.com/funding/github/packagist/composer/composer", |
|
224 |
+ "type": "tidelift" |
|
225 |
+ } |
|
226 |
+ ], |
|
227 |
+ "time": "2022-02-25T21:32:43+00:00" |
|
228 |
+ }, |
|
229 |
+ { |
|
230 |
+ "name": "friendsofphp/php-cs-fixer", |
|
231 |
+ "version": "dev-master", |
|
232 |
+ "source": { |
|
233 |
+ "type": "git", |
|
234 |
+ "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", |
|
235 |
+ "reference": "1fc90dab144861a85c239da31f7bec079c47d31f" |
|
236 |
+ }, |
|
237 |
+ "dist": { |
|
238 |
+ "type": "zip", |
|
239 |
+ "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/1fc90dab144861a85c239da31f7bec079c47d31f", |
|
240 |
+ "reference": "1fc90dab144861a85c239da31f7bec079c47d31f", |
|
241 |
+ "shasum": "" |
|
242 |
+ }, |
|
243 |
+ "require": { |
|
244 |
+ "composer/semver": "^3.4", |
|
245 |
+ "composer/xdebug-handler": "^3.0.3", |
|
246 |
+ "ext-filter": "*", |
|
247 |
+ "ext-json": "*", |
|
248 |
+ "ext-tokenizer": "*", |
|
249 |
+ "php": "^7.4 || ^8.0", |
|
250 |
+ "sebastian/diff": "^4.0 || ^5.0", |
|
251 |
+ "symfony/console": "^5.4 || ^6.0 || ^7.0", |
|
252 |
+ "symfony/event-dispatcher": "^5.4 || ^6.0 || ^7.0", |
|
253 |
+ "symfony/filesystem": "^5.4 || ^6.0 || ^7.0", |
|
254 |
+ "symfony/finder": "^5.4 || ^6.0 || ^7.0", |
|
255 |
+ "symfony/options-resolver": "^5.4 || ^6.0 || ^7.0", |
|
256 |
+ "symfony/polyfill-mbstring": "^1.28", |
|
257 |
+ "symfony/polyfill-php80": "^1.28", |
|
258 |
+ "symfony/polyfill-php81": "^1.28", |
|
259 |
+ "symfony/process": "^5.4 || ^6.0 || ^7.0", |
|
260 |
+ "symfony/stopwatch": "^5.4 || ^6.0 || ^7.0" |
|
261 |
+ }, |
|
262 |
+ "require-dev": { |
|
263 |
+ "facile-it/paraunit": "^1.3 || ^2.0", |
|
264 |
+ "justinrainbow/json-schema": "^5.2", |
|
265 |
+ "keradus/cli-executor": "^2.1", |
|
266 |
+ "mikey179/vfsstream": "^1.6.11", |
|
267 |
+ "php-coveralls/php-coveralls": "^2.7", |
|
268 |
+ "php-cs-fixer/accessible-object": "^1.1", |
|
269 |
+ "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.4", |
|
270 |
+ "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.4", |
|
271 |
+ "phpunit/phpunit": "^9.6 || ^10.5.5", |
|
272 |
+ "symfony/var-dumper": "^5.4 || ^6.0 || ^7.0", |
|
273 |
+ "symfony/yaml": "^5.4 || ^6.0 || ^7.0" |
|
274 |
+ }, |
|
275 |
+ "suggest": { |
|
276 |
+ "ext-dom": "For handling output formats in XML", |
|
277 |
+ "ext-mbstring": "For handling non-UTF8 characters." |
|
278 |
+ }, |
|
279 |
+ "default-branch": true, |
|
280 |
+ "bin": [ |
|
281 |
+ "php-cs-fixer" |
|
282 |
+ ], |
|
283 |
+ "type": "application", |
|
284 |
+ "autoload": { |
|
285 |
+ "psr-4": { |
|
286 |
+ "PhpCsFixer\\": "src/" |
|
287 |
+ } |
|
288 |
+ }, |
|
289 |
+ "notification-url": "https://packagist.org/downloads/", |
|
290 |
+ "license": [ |
|
291 |
+ "MIT" |
|
292 |
+ ], |
|
293 |
+ "authors": [ |
|
294 |
+ { |
|
295 |
+ "name": "Fabien Potencier", |
|
296 |
+ "email": "fabien@symfony.com" |
|
297 |
+ }, |
|
298 |
+ { |
|
299 |
+ "name": "Dariusz Rumiński", |
|
300 |
+ "email": "dariusz.ruminski@gmail.com" |
|
301 |
+ } |
|
302 |
+ ], |
|
303 |
+ "description": "A tool to automatically fix PHP code style", |
|
304 |
+ "keywords": [ |
|
305 |
+ "Static code analysis", |
|
306 |
+ "fixer", |
|
307 |
+ "standards", |
|
308 |
+ "static analysis" |
|
309 |
+ ], |
|
310 |
+ "support": { |
|
311 |
+ "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", |
|
312 |
+ "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/master" |
|
313 |
+ }, |
|
314 |
+ "funding": [ |
|
315 |
+ { |
|
316 |
+ "url": "https://github.com/keradus", |
|
317 |
+ "type": "github" |
|
318 |
+ } |
|
319 |
+ ], |
|
320 |
+ "time": "2024-02-03T11:02:41+00:00" |
|
321 |
+ }, |
|
322 |
+ { |
|
323 |
+ "name": "psr/container", |
|
324 |
+ "version": "dev-master", |
|
325 |
+ "source": { |
|
326 |
+ "type": "git", |
|
327 |
+ "url": "https://github.com/php-fig/container.git", |
|
328 |
+ "reference": "707984727bd5b2b670e59559d3ed2500240cf875" |
|
329 |
+ }, |
|
330 |
+ "dist": { |
|
331 |
+ "type": "zip", |
|
332 |
+ "url": "https://api.github.com/repos/php-fig/container/zipball/707984727bd5b2b670e59559d3ed2500240cf875", |
|
333 |
+ "reference": "707984727bd5b2b670e59559d3ed2500240cf875", |
|
334 |
+ "shasum": "" |
|
335 |
+ }, |
|
336 |
+ "require": { |
|
337 |
+ "php": ">=7.4.0" |
|
338 |
+ }, |
|
339 |
+ "default-branch": true, |
|
340 |
+ "type": "library", |
|
341 |
+ "extra": { |
|
342 |
+ "branch-alias": { |
|
343 |
+ "dev-master": "2.0.x-dev" |
|
344 |
+ } |
|
345 |
+ }, |
|
346 |
+ "autoload": { |
|
347 |
+ "psr-4": { |
|
348 |
+ "Psr\\Container\\": "src/" |
|
349 |
+ } |
|
350 |
+ }, |
|
351 |
+ "notification-url": "https://packagist.org/downloads/", |
|
352 |
+ "license": [ |
|
353 |
+ "MIT" |
|
354 |
+ ], |
|
355 |
+ "authors": [ |
|
356 |
+ { |
|
357 |
+ "name": "PHP-FIG", |
|
358 |
+ "homepage": "https://www.php-fig.org/" |
|
359 |
+ } |
|
360 |
+ ], |
|
361 |
+ "description": "Common Container Interface (PHP FIG PSR-11)", |
|
362 |
+ "homepage": "https://github.com/php-fig/container", |
|
363 |
+ "keywords": [ |
|
364 |
+ "PSR-11", |
|
365 |
+ "container", |
|
366 |
+ "container-interface", |
|
367 |
+ "container-interop", |
|
368 |
+ "psr" |
|
369 |
+ ], |
|
370 |
+ "support": { |
|
371 |
+ "issues": "https://github.com/php-fig/container/issues", |
|
372 |
+ "source": "https://github.com/php-fig/container" |
|
373 |
+ }, |
|
374 |
+ "time": "2023-09-22T11:11:30+00:00" |
|
375 |
+ }, |
|
376 |
+ { |
|
377 |
+ "name": "psr/event-dispatcher", |
|
378 |
+ "version": "dev-master", |
|
379 |
+ "source": { |
|
380 |
+ "type": "git", |
|
381 |
+ "url": "https://github.com/php-fig/event-dispatcher.git", |
|
382 |
+ "reference": "977ffcf551e3bfb73d90aac3e8e1583fd8d2f89a" |
|
383 |
+ }, |
|
384 |
+ "dist": { |
|
385 |
+ "type": "zip", |
|
386 |
+ "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/977ffcf551e3bfb73d90aac3e8e1583fd8d2f89a", |
|
387 |
+ "reference": "977ffcf551e3bfb73d90aac3e8e1583fd8d2f89a", |
|
388 |
+ "shasum": "" |
|
389 |
+ }, |
|
390 |
+ "require": { |
|
391 |
+ "php": ">=7.2.0" |
|
392 |
+ }, |
|
393 |
+ "suggest": { |
|
394 |
+ "fig/event-dispatcher-util": "Provides some useful PSR-14 utilities" |
|
395 |
+ }, |
|
396 |
+ "default-branch": true, |
|
397 |
+ "type": "library", |
|
398 |
+ "extra": { |
|
399 |
+ "branch-alias": { |
|
400 |
+ "dev-master": "1.0.x-dev" |
|
401 |
+ } |
|
402 |
+ }, |
|
403 |
+ "autoload": { |
|
404 |
+ "psr-4": { |
|
405 |
+ "Psr\\EventDispatcher\\": "src/" |
|
406 |
+ } |
|
407 |
+ }, |
|
408 |
+ "notification-url": "https://packagist.org/downloads/", |
|
409 |
+ "license": [ |
|
410 |
+ "MIT" |
|
411 |
+ ], |
|
412 |
+ "authors": [ |
|
413 |
+ { |
|
414 |
+ "name": "PHP-FIG", |
|
415 |
+ "homepage": "https://www.php-fig.org/" |
|
416 |
+ } |
|
417 |
+ ], |
|
418 |
+ "description": "Standard interfaces for event handling.", |
|
419 |
+ "keywords": [ |
|
420 |
+ "events", |
|
421 |
+ "psr", |
|
422 |
+ "psr-14" |
|
423 |
+ ], |
|
424 |
+ "support": { |
|
425 |
+ "source": "https://github.com/php-fig/event-dispatcher" |
|
426 |
+ }, |
|
427 |
+ "time": "2023-09-22T11:10:57+00:00" |
|
428 |
+ }, |
|
429 |
+ { |
|
430 |
+ "name": "psr/log", |
|
431 |
+ "version": "dev-master", |
|
432 |
+ "source": { |
|
433 |
+ "type": "git", |
|
434 |
+ "url": "https://github.com/php-fig/log.git", |
|
435 |
+ "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001" |
|
436 |
+ }, |
|
437 |
+ "dist": { |
|
438 |
+ "type": "zip", |
|
439 |
+ "url": "https://api.github.com/repos/php-fig/log/zipball/fe5ea303b0887d5caefd3d431c3e61ad47037001", |
|
440 |
+ "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001", |
|
441 |
+ "shasum": "" |
|
442 |
+ }, |
|
443 |
+ "require": { |
|
444 |
+ "php": ">=8.0.0" |
|
445 |
+ }, |
|
446 |
+ "default-branch": true, |
|
447 |
+ "type": "library", |
|
448 |
+ "extra": { |
|
449 |
+ "branch-alias": { |
|
450 |
+ "dev-master": "3.x-dev" |
|
451 |
+ } |
|
452 |
+ }, |
|
453 |
+ "autoload": { |
|
454 |
+ "psr-4": { |
|
455 |
+ "Psr\\Log\\": "src" |
|
456 |
+ } |
|
457 |
+ }, |
|
458 |
+ "notification-url": "https://packagist.org/downloads/", |
|
459 |
+ "license": [ |
|
460 |
+ "MIT" |
|
461 |
+ ], |
|
462 |
+ "authors": [ |
|
463 |
+ { |
|
464 |
+ "name": "PHP-FIG", |
|
465 |
+ "homepage": "https://www.php-fig.org/" |
|
466 |
+ } |
|
467 |
+ ], |
|
468 |
+ "description": "Common interface for logging libraries", |
|
469 |
+ "homepage": "https://github.com/php-fig/log", |
|
470 |
+ "keywords": [ |
|
471 |
+ "log", |
|
472 |
+ "psr", |
|
473 |
+ "psr-3" |
|
474 |
+ ], |
|
475 |
+ "support": { |
|
476 |
+ "source": "https://github.com/php-fig/log/tree/3.0.0" |
|
477 |
+ }, |
|
478 |
+ "time": "2021-07-14T16:46:02+00:00" |
|
479 |
+ }, |
|
480 |
+ { |
|
481 |
+ "name": "sebastian/diff", |
|
482 |
+ "version": "5.1.x-dev", |
|
483 |
+ "source": { |
|
484 |
+ "type": "git", |
|
485 |
+ "url": "https://github.com/sebastianbergmann/diff.git", |
|
486 |
+ "reference": "86649b78a5c4175cdf281855c7876141bed1968e" |
|
487 |
+ }, |
|
488 |
+ "dist": { |
|
489 |
+ "type": "zip", |
|
490 |
+ "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/86649b78a5c4175cdf281855c7876141bed1968e", |
|
491 |
+ "reference": "86649b78a5c4175cdf281855c7876141bed1968e", |
|
492 |
+ "shasum": "" |
|
493 |
+ }, |
|
494 |
+ "require": { |
|
495 |
+ "php": ">=8.1" |
|
496 |
+ }, |
|
497 |
+ "require-dev": { |
|
498 |
+ "phpunit/phpunit": "^10.0", |
|
499 |
+ "symfony/process": "^6.4" |
|
500 |
+ }, |
|
501 |
+ "type": "library", |
|
502 |
+ "extra": { |
|
503 |
+ "branch-alias": { |
|
504 |
+ "dev-main": "5.1-dev" |
|
505 |
+ } |
|
506 |
+ }, |
|
507 |
+ "autoload": { |
|
508 |
+ "classmap": [ |
|
509 |
+ "src/" |
|
510 |
+ ] |
|
511 |
+ }, |
|
512 |
+ "notification-url": "https://packagist.org/downloads/", |
|
513 |
+ "license": [ |
|
514 |
+ "BSD-3-Clause" |
|
515 |
+ ], |
|
516 |
+ "authors": [ |
|
517 |
+ { |
|
518 |
+ "name": "Sebastian Bergmann", |
|
519 |
+ "email": "sebastian@phpunit.de" |
|
520 |
+ }, |
|
521 |
+ { |
|
522 |
+ "name": "Kore Nordmann", |
|
523 |
+ "email": "mail@kore-nordmann.de" |
|
524 |
+ } |
|
525 |
+ ], |
|
526 |
+ "description": "Diff implementation", |
|
527 |
+ "homepage": "https://github.com/sebastianbergmann/diff", |
|
528 |
+ "keywords": [ |
|
529 |
+ "diff", |
|
530 |
+ "udiff", |
|
531 |
+ "unidiff", |
|
532 |
+ "unified diff" |
|
533 |
+ ], |
|
534 |
+ "support": { |
|
535 |
+ "issues": "https://github.com/sebastianbergmann/diff/issues", |
|
536 |
+ "security": "https://github.com/sebastianbergmann/diff/security/policy", |
|
537 |
+ "source": "https://github.com/sebastianbergmann/diff/tree/5.1" |
|
538 |
+ }, |
|
539 |
+ "funding": [ |
|
540 |
+ { |
|
541 |
+ "url": "https://github.com/sebastianbergmann", |
|
542 |
+ "type": "github" |
|
543 |
+ } |
|
544 |
+ ], |
|
545 |
+ "time": "2024-01-30T13:46:00+00:00" |
|
546 |
+ }, |
|
547 |
+ { |
|
548 |
+ "name": "symfony/console", |
|
549 |
+ "version": "7.1.x-dev", |
|
550 |
+ "source": { |
|
551 |
+ "type": "git", |
|
552 |
+ "url": "https://github.com/symfony/console.git", |
|
553 |
+ "reference": "82efc31d66f28eebfc21d23736fdadf4cb258f74" |
|
554 |
+ }, |
|
555 |
+ "dist": { |
|
556 |
+ "type": "zip", |
|
557 |
+ "url": "https://api.github.com/repos/symfony/console/zipball/82efc31d66f28eebfc21d23736fdadf4cb258f74", |
|
558 |
+ "reference": "82efc31d66f28eebfc21d23736fdadf4cb258f74", |
|
559 |
+ "shasum": "" |
|
560 |
+ }, |
|
561 |
+ "require": { |
|
562 |
+ "php": ">=8.2", |
|
563 |
+ "symfony/polyfill-mbstring": "~1.0", |
|
564 |
+ "symfony/service-contracts": "^2.5|^3", |
|
565 |
+ "symfony/string": "^6.4|^7.0" |
|
566 |
+ }, |
|
567 |
+ "conflict": { |
|
568 |
+ "symfony/dependency-injection": "<6.4", |
|
569 |
+ "symfony/dotenv": "<6.4", |
|
570 |
+ "symfony/event-dispatcher": "<6.4", |
|
571 |
+ "symfony/lock": "<6.4", |
|
572 |
+ "symfony/process": "<6.4" |
|
573 |
+ }, |
|
574 |
+ "provide": { |
|
575 |
+ "psr/log-implementation": "1.0|2.0|3.0" |
|
576 |
+ }, |
|
577 |
+ "require-dev": { |
|
578 |
+ "psr/log": "^1|^2|^3", |
|
579 |
+ "symfony/config": "^6.4|^7.0", |
|
580 |
+ "symfony/dependency-injection": "^6.4|^7.0", |
|
581 |
+ "symfony/event-dispatcher": "^6.4|^7.0", |
|
582 |
+ "symfony/http-foundation": "^6.4|^7.0", |
|
583 |
+ "symfony/http-kernel": "^6.4|^7.0", |
|
584 |
+ "symfony/lock": "^6.4|^7.0", |
|
585 |
+ "symfony/messenger": "^6.4|^7.0", |
|
586 |
+ "symfony/process": "^6.4|^7.0", |
|
587 |
+ "symfony/stopwatch": "^6.4|^7.0", |
|
588 |
+ "symfony/var-dumper": "^6.4|^7.0" |
|
589 |
+ }, |
|
590 |
+ "type": "library", |
|
591 |
+ "autoload": { |
|
592 |
+ "psr-4": { |
|
593 |
+ "Symfony\\Component\\Console\\": "" |
|
594 |
+ }, |
|
595 |
+ "exclude-from-classmap": [ |
|
596 |
+ "/Tests/" |
|
597 |
+ ] |
|
598 |
+ }, |
|
599 |
+ "notification-url": "https://packagist.org/downloads/", |
|
600 |
+ "license": [ |
|
601 |
+ "MIT" |
|
602 |
+ ], |
|
603 |
+ "authors": [ |
|
604 |
+ { |
|
605 |
+ "name": "Fabien Potencier", |
|
606 |
+ "email": "fabien@symfony.com" |
|
607 |
+ }, |
|
608 |
+ { |
|
609 |
+ "name": "Symfony Community", |
|
610 |
+ "homepage": "https://symfony.com/contributors" |
|
611 |
+ } |
|
612 |
+ ], |
|
613 |
+ "description": "Eases the creation of beautiful and testable command line interfaces", |
|
614 |
+ "homepage": "https://symfony.com", |
|
615 |
+ "keywords": [ |
|
616 |
+ "cli", |
|
617 |
+ "command-line", |
|
618 |
+ "console", |
|
619 |
+ "terminal" |
|
620 |
+ ], |
|
621 |
+ "support": { |
|
622 |
+ "source": "https://github.com/symfony/console/tree/7.1" |
|
623 |
+ }, |
|
624 |
+ "funding": [ |
|
625 |
+ { |
|
626 |
+ "url": "https://symfony.com/sponsor", |
|
627 |
+ "type": "custom" |
|
628 |
+ }, |
|
629 |
+ { |
|
630 |
+ "url": "https://github.com/fabpot", |
|
631 |
+ "type": "github" |
|
632 |
+ }, |
|
633 |
+ { |
|
634 |
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", |
|
635 |
+ "type": "tidelift" |
|
636 |
+ } |
|
637 |
+ ], |
|
638 |
+ "time": "2024-02-03T16:11:47+00:00" |
|
639 |
+ }, |
|
640 |
+ { |
|
641 |
+ "name": "symfony/deprecation-contracts", |
|
642 |
+ "version": "dev-main", |
|
643 |
+ "source": { |
|
644 |
+ "type": "git", |
|
645 |
+ "url": "https://github.com/symfony/deprecation-contracts.git", |
|
646 |
+ "reference": "2c438b99bb2753c1628c1e6f523991edea5b03a4" |
|
647 |
+ }, |
|
648 |
+ "dist": { |
|
649 |
+ "type": "zip", |
|
650 |
+ "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/2c438b99bb2753c1628c1e6f523991edea5b03a4", |
|
651 |
+ "reference": "2c438b99bb2753c1628c1e6f523991edea5b03a4", |
|
652 |
+ "shasum": "" |
|
653 |
+ }, |
|
654 |
+ "require": { |
|
655 |
+ "php": ">=8.1" |
|
656 |
+ }, |
|
657 |
+ "default-branch": true, |
|
658 |
+ "type": "library", |
|
659 |
+ "extra": { |
|
660 |
+ "branch-alias": { |
|
661 |
+ "dev-main": "3.5-dev" |
|
662 |
+ }, |
|
663 |
+ "thanks": { |
|
664 |
+ "name": "symfony/contracts", |
|
665 |
+ "url": "https://github.com/symfony/contracts" |
|
666 |
+ } |
|
667 |
+ }, |
|
668 |
+ "autoload": { |
|
669 |
+ "files": [ |
|
670 |
+ "function.php" |
|
671 |
+ ] |
|
672 |
+ }, |
|
673 |
+ "notification-url": "https://packagist.org/downloads/", |
|
674 |
+ "license": [ |
|
675 |
+ "MIT" |
|
676 |
+ ], |
|
677 |
+ "authors": [ |
|
678 |
+ { |
|
679 |
+ "name": "Nicolas Grekas", |
|
680 |
+ "email": "p@tchwork.com" |
|
681 |
+ }, |
|
682 |
+ { |
|
683 |
+ "name": "Symfony Community", |
|
684 |
+ "homepage": "https://symfony.com/contributors" |
|
685 |
+ } |
|
686 |
+ ], |
|
687 |
+ "description": "A generic function and convention to trigger deprecation notices", |
|
688 |
+ "homepage": "https://symfony.com", |
|
689 |
+ "support": { |
|
690 |
+ "source": "https://github.com/symfony/deprecation-contracts/tree/main" |
|
691 |
+ }, |
|
692 |
+ "funding": [ |
|
693 |
+ { |
|
694 |
+ "url": "https://symfony.com/sponsor", |
|
695 |
+ "type": "custom" |
|
696 |
+ }, |
|
697 |
+ { |
|
698 |
+ "url": "https://github.com/fabpot", |
|
699 |
+ "type": "github" |
|
700 |
+ }, |
|
701 |
+ { |
|
702 |
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", |
|
703 |
+ "type": "tidelift" |
|
704 |
+ } |
|
705 |
+ ], |
|
706 |
+ "time": "2024-01-02T14:07:37+00:00" |
|
707 |
+ }, |
|
708 |
+ { |
|
709 |
+ "name": "symfony/event-dispatcher", |
|
710 |
+ "version": "7.1.x-dev", |
|
711 |
+ "source": { |
|
712 |
+ "type": "git", |
|
713 |
+ "url": "https://github.com/symfony/event-dispatcher.git", |
|
714 |
+ "reference": "5bb99ba359e39909230a22e343271e9385bbee08" |
|
715 |
+ }, |
|
716 |
+ "dist": { |
|
717 |
+ "type": "zip", |
|
718 |
+ "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/5bb99ba359e39909230a22e343271e9385bbee08", |
|
719 |
+ "reference": "5bb99ba359e39909230a22e343271e9385bbee08", |
|
720 |
+ "shasum": "" |
|
721 |
+ }, |
|
722 |
+ "require": { |
|
723 |
+ "php": ">=8.2", |
|
724 |
+ "symfony/event-dispatcher-contracts": "^2.5|^3" |
|
725 |
+ }, |
|
726 |
+ "conflict": { |
|
727 |
+ "symfony/dependency-injection": "<6.4", |
|
728 |
+ "symfony/service-contracts": "<2.5" |
|
729 |
+ }, |
|
730 |
+ "provide": { |
|
731 |
+ "psr/event-dispatcher-implementation": "1.0", |
|
732 |
+ "symfony/event-dispatcher-implementation": "2.0|3.0" |
|
733 |
+ }, |
|
734 |
+ "require-dev": { |
|
735 |
+ "psr/log": "^1|^2|^3", |
|
736 |
+ "symfony/config": "^6.4|^7.0", |
|
737 |
+ "symfony/dependency-injection": "^6.4|^7.0", |
|
738 |
+ "symfony/error-handler": "^6.4|^7.0", |
|
739 |
+ "symfony/expression-language": "^6.4|^7.0", |
|
740 |
+ "symfony/http-foundation": "^6.4|^7.0", |
|
741 |
+ "symfony/service-contracts": "^2.5|^3", |
|
742 |
+ "symfony/stopwatch": "^6.4|^7.0" |
|
743 |
+ }, |
|
744 |
+ "type": "library", |
|
745 |
+ "autoload": { |
|
746 |
+ "psr-4": { |
|
747 |
+ "Symfony\\Component\\EventDispatcher\\": "" |
|
748 |
+ }, |
|
749 |
+ "exclude-from-classmap": [ |
|
750 |
+ "/Tests/" |
|
751 |
+ ] |
|
752 |
+ }, |
|
753 |
+ "notification-url": "https://packagist.org/downloads/", |
|
754 |
+ "license": [ |
|
755 |
+ "MIT" |
|
756 |
+ ], |
|
757 |
+ "authors": [ |
|
758 |
+ { |
|
759 |
+ "name": "Fabien Potencier", |
|
760 |
+ "email": "fabien@symfony.com" |
|
761 |
+ }, |
|
762 |
+ { |
|
763 |
+ "name": "Symfony Community", |
|
764 |
+ "homepage": "https://symfony.com/contributors" |
|
765 |
+ } |
|
766 |
+ ], |
|
767 |
+ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", |
|
768 |
+ "homepage": "https://symfony.com", |
|
769 |
+ "support": { |
|
770 |
+ "source": "https://github.com/symfony/event-dispatcher/tree/7.1" |
|
771 |
+ }, |
|
772 |
+ "funding": [ |
|
773 |
+ { |
|
774 |
+ "url": "https://symfony.com/sponsor", |
|
775 |
+ "type": "custom" |
|
776 |
+ }, |
|
777 |
+ { |
|
778 |
+ "url": "https://github.com/fabpot", |
|
779 |
+ "type": "github" |
|
780 |
+ }, |
|
781 |
+ { |
|
782 |
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", |
|
783 |
+ "type": "tidelift" |
|
784 |
+ } |
|
785 |
+ ], |
|
786 |
+ "time": "2024-01-23T15:06:13+00:00" |
|
787 |
+ }, |
|
788 |
+ { |
|
789 |
+ "name": "symfony/event-dispatcher-contracts", |
|
790 |
+ "version": "dev-main", |
|
791 |
+ "source": { |
|
792 |
+ "type": "git", |
|
793 |
+ "url": "https://github.com/symfony/event-dispatcher-contracts.git", |
|
794 |
+ "reference": "4d4ea14a8d31bc995e29bdbd566ac07c9fd004f5" |
|
795 |
+ }, |
|
796 |
+ "dist": { |
|
797 |
+ "type": "zip", |
|
798 |
+ "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/4d4ea14a8d31bc995e29bdbd566ac07c9fd004f5", |
|
799 |
+ "reference": "4d4ea14a8d31bc995e29bdbd566ac07c9fd004f5", |
|
800 |
+ "shasum": "" |
|
801 |
+ }, |
|
802 |
+ "require": { |
|
803 |
+ "php": ">=8.1", |
|
804 |
+ "psr/event-dispatcher": "^1" |
|
805 |
+ }, |
|
806 |
+ "default-branch": true, |
|
807 |
+ "type": "library", |
|
808 |
+ "extra": { |
|
809 |
+ "branch-alias": { |
|
810 |
+ "dev-main": "3.5-dev" |
|
811 |
+ }, |
|
812 |
+ "thanks": { |
|
813 |
+ "name": "symfony/contracts", |
|
814 |
+ "url": "https://github.com/symfony/contracts" |
|
815 |
+ } |
|
816 |
+ }, |
|
817 |
+ "autoload": { |
|
818 |
+ "psr-4": { |
|
819 |
+ "Symfony\\Contracts\\EventDispatcher\\": "" |
|
820 |
+ } |
|
821 |
+ }, |
|
822 |
+ "notification-url": "https://packagist.org/downloads/", |
|
823 |
+ "license": [ |
|
824 |
+ "MIT" |
|
825 |
+ ], |
|
826 |
+ "authors": [ |
|
827 |
+ { |
|
828 |
+ "name": "Nicolas Grekas", |
|
829 |
+ "email": "p@tchwork.com" |
|
830 |
+ }, |
|
831 |
+ { |
|
832 |
+ "name": "Symfony Community", |
|
833 |
+ "homepage": "https://symfony.com/contributors" |
|
834 |
+ } |
|
835 |
+ ], |
|
836 |
+ "description": "Generic abstractions related to dispatching event", |
|
837 |
+ "homepage": "https://symfony.com", |
|
838 |
+ "keywords": [ |
|
839 |
+ "abstractions", |
|
840 |
+ "contracts", |
|
841 |
+ "decoupling", |
|
842 |
+ "interfaces", |
|
843 |
+ "interoperability", |
|
844 |
+ "standards" |
|
845 |
+ ], |
|
846 |
+ "support": { |
|
847 |
+ "source": "https://github.com/symfony/event-dispatcher-contracts/tree/main" |
|
848 |
+ }, |
|
849 |
+ "funding": [ |
|
850 |
+ { |
|
851 |
+ "url": "https://symfony.com/sponsor", |
|
852 |
+ "type": "custom" |
|
853 |
+ }, |
|
854 |
+ { |
|
855 |
+ "url": "https://github.com/fabpot", |
|
856 |
+ "type": "github" |
|
857 |
+ }, |
|
858 |
+ { |
|
859 |
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", |
|
860 |
+ "type": "tidelift" |
|
861 |
+ } |
|
862 |
+ ], |
|
863 |
+ "time": "2024-01-23T15:06:13+00:00" |
|
864 |
+ }, |
|
865 |
+ { |
|
866 |
+ "name": "symfony/filesystem", |
|
867 |
+ "version": "7.1.x-dev", |
|
868 |
+ "source": { |
|
869 |
+ "type": "git", |
|
870 |
+ "url": "https://github.com/symfony/filesystem.git", |
|
871 |
+ "reference": "60d42aa14bdecc7f488988430a144fed084c81e2" |
|
872 |
+ }, |
|
873 |
+ "dist": { |
|
874 |
+ "type": "zip", |
|
875 |
+ "url": "https://api.github.com/repos/symfony/filesystem/zipball/60d42aa14bdecc7f488988430a144fed084c81e2", |
|
876 |
+ "reference": "60d42aa14bdecc7f488988430a144fed084c81e2", |
|
877 |
+ "shasum": "" |
|
878 |
+ }, |
|
879 |
+ "require": { |
|
880 |
+ "php": ">=8.2", |
|
881 |
+ "symfony/polyfill-ctype": "~1.8", |
|
882 |
+ "symfony/polyfill-mbstring": "~1.8" |
|
883 |
+ }, |
|
884 |
+ "type": "library", |
|
885 |
+ "autoload": { |
|
886 |
+ "psr-4": { |
|
887 |
+ "Symfony\\Component\\Filesystem\\": "" |
|
888 |
+ }, |
|
889 |
+ "exclude-from-classmap": [ |
|
890 |
+ "/Tests/" |
|
891 |
+ ] |
|
892 |
+ }, |
|
893 |
+ "notification-url": "https://packagist.org/downloads/", |
|
894 |
+ "license": [ |
|
895 |
+ "MIT" |
|
896 |
+ ], |
|
897 |
+ "authors": [ |
|
898 |
+ { |
|
899 |
+ "name": "Fabien Potencier", |
|
900 |
+ "email": "fabien@symfony.com" |
|
901 |
+ }, |
|
902 |
+ { |
|
903 |
+ "name": "Symfony Community", |
|
904 |
+ "homepage": "https://symfony.com/contributors" |
|
905 |
+ } |
|
906 |
+ ], |
|
907 |
+ "description": "Provides basic utilities for the filesystem", |
|
908 |
+ "homepage": "https://symfony.com", |
|
909 |
+ "support": { |
|
910 |
+ "source": "https://github.com/symfony/filesystem/tree/7.1" |
|
911 |
+ }, |
|
912 |
+ "funding": [ |
|
913 |
+ { |
|
914 |
+ "url": "https://symfony.com/sponsor", |
|
915 |
+ "type": "custom" |
|
916 |
+ }, |
|
917 |
+ { |
|
918 |
+ "url": "https://github.com/fabpot", |
|
919 |
+ "type": "github" |
|
920 |
+ }, |
|
921 |
+ { |
|
922 |
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", |
|
923 |
+ "type": "tidelift" |
|
924 |
+ } |
|
925 |
+ ], |
|
926 |
+ "time": "2024-01-23T15:06:13+00:00" |
|
927 |
+ }, |
|
928 |
+ { |
|
929 |
+ "name": "symfony/finder", |
|
930 |
+ "version": "7.1.x-dev", |
|
931 |
+ "source": { |
|
932 |
+ "type": "git", |
|
933 |
+ "url": "https://github.com/symfony/finder.git", |
|
934 |
+ "reference": "beeac2ba50a5dd729d8a23507ad09cdd0f82110c" |
|
935 |
+ }, |
|
936 |
+ "dist": { |
|
937 |
+ "type": "zip", |
|
938 |
+ "url": "https://api.github.com/repos/symfony/finder/zipball/beeac2ba50a5dd729d8a23507ad09cdd0f82110c", |
|
939 |
+ "reference": "beeac2ba50a5dd729d8a23507ad09cdd0f82110c", |
|
940 |
+ "shasum": "" |
|
941 |
+ }, |
|
942 |
+ "require": { |
|
943 |
+ "php": ">=8.2" |
|
944 |
+ }, |
|
945 |
+ "require-dev": { |
|
946 |
+ "symfony/filesystem": "^6.4|^7.0" |
|
947 |
+ }, |
|
948 |
+ "type": "library", |
|
949 |
+ "autoload": { |
|
950 |
+ "psr-4": { |
|
951 |
+ "Symfony\\Component\\Finder\\": "" |
|
952 |
+ }, |
|
953 |
+ "exclude-from-classmap": [ |
|
954 |
+ "/Tests/" |
|
955 |
+ ] |
|
956 |
+ }, |
|
957 |
+ "notification-url": "https://packagist.org/downloads/", |
|
958 |
+ "license": [ |
|
959 |
+ "MIT" |
|
960 |
+ ], |
|
961 |
+ "authors": [ |
|
962 |
+ { |
|
963 |
+ "name": "Fabien Potencier", |
|
964 |
+ "email": "fabien@symfony.com" |
|
965 |
+ }, |
|
966 |
+ { |
|
967 |
+ "name": "Symfony Community", |
|
968 |
+ "homepage": "https://symfony.com/contributors" |
|
969 |
+ } |
|
970 |
+ ], |
|
971 |
+ "description": "Finds files and directories via an intuitive fluent interface", |
|
972 |
+ "homepage": "https://symfony.com", |
|
973 |
+ "support": { |
|
974 |
+ "source": "https://github.com/symfony/finder/tree/7.1" |
|
975 |
+ }, |
|
976 |
+ "funding": [ |
|
977 |
+ { |
|
978 |
+ "url": "https://symfony.com/sponsor", |
|
979 |
+ "type": "custom" |
|
980 |
+ }, |
|
981 |
+ { |
|
982 |
+ "url": "https://github.com/fabpot", |
|
983 |
+ "type": "github" |
|
984 |
+ }, |
|
985 |
+ { |
|
986 |
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", |
|
987 |
+ "type": "tidelift" |
|
988 |
+ } |
|
989 |
+ ], |
|
990 |
+ "time": "2024-01-16T21:21:05+00:00" |
|
991 |
+ }, |
|
992 |
+ { |
|
993 |
+ "name": "symfony/options-resolver", |
|
994 |
+ "version": "7.1.x-dev", |
|
995 |
+ "source": { |
|
996 |
+ "type": "git", |
|
997 |
+ "url": "https://github.com/symfony/options-resolver.git", |
|
998 |
+ "reference": "700ff4096e346f54cb628ea650767c8130f1001f" |
|
999 |
+ }, |
|
1000 |
+ "dist": { |
|
1001 |
+ "type": "zip", |
|
1002 |
+ "url": "https://api.github.com/repos/symfony/options-resolver/zipball/700ff4096e346f54cb628ea650767c8130f1001f", |
|
1003 |
+ "reference": "700ff4096e346f54cb628ea650767c8130f1001f", |
|
1004 |
+ "shasum": "" |
|
1005 |
+ }, |
|
1006 |
+ "require": { |
|
1007 |
+ "php": ">=8.2", |
|
1008 |
+ "symfony/deprecation-contracts": "^2.5|^3" |
|
1009 |
+ }, |
|
1010 |
+ "type": "library", |
|
1011 |
+ "autoload": { |
|
1012 |
+ "psr-4": { |
|
1013 |
+ "Symfony\\Component\\OptionsResolver\\": "" |
|
1014 |
+ }, |
|
1015 |
+ "exclude-from-classmap": [ |
|
1016 |
+ "/Tests/" |
|
1017 |
+ ] |
|
1018 |
+ }, |
|
1019 |
+ "notification-url": "https://packagist.org/downloads/", |
|
1020 |
+ "license": [ |
|
1021 |
+ "MIT" |
|
1022 |
+ ], |
|
1023 |
+ "authors": [ |
|
1024 |
+ { |
|
1025 |
+ "name": "Fabien Potencier", |
|
1026 |
+ "email": "fabien@symfony.com" |
|
1027 |
+ }, |
|
1028 |
+ { |
|
1029 |
+ "name": "Symfony Community", |
|
1030 |
+ "homepage": "https://symfony.com/contributors" |
|
1031 |
+ } |
|
1032 |
+ ], |
|
1033 |
+ "description": "Provides an improved replacement for the array_replace PHP function", |
|
1034 |
+ "homepage": "https://symfony.com", |
|
1035 |
+ "keywords": [ |
|
1036 |
+ "config", |
|
1037 |
+ "configuration", |
|
1038 |
+ "options" |
|
1039 |
+ ], |
|
1040 |
+ "support": { |
|
1041 |
+ "source": "https://github.com/symfony/options-resolver/tree/v7.0.0-RC1" |
|
1042 |
+ }, |
|
1043 |
+ "funding": [ |
|
1044 |
+ { |
|
1045 |
+ "url": "https://symfony.com/sponsor", |
|
1046 |
+ "type": "custom" |
|
1047 |
+ }, |
|
1048 |
+ { |
|
1049 |
+ "url": "https://github.com/fabpot", |
|
1050 |
+ "type": "github" |
|
1051 |
+ }, |
|
1052 |
+ { |
|
1053 |
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", |
|
1054 |
+ "type": "tidelift" |
|
1055 |
+ } |
|
1056 |
+ ], |
|
1057 |
+ "time": "2023-08-08T10:20:21+00:00" |
|
1058 |
+ }, |
|
1059 |
+ { |
|
1060 |
+ "name": "symfony/polyfill-ctype", |
|
1061 |
+ "version": "1.x-dev", |
|
1062 |
+ "source": { |
|
1063 |
+ "type": "git", |
|
1064 |
+ "url": "https://github.com/symfony/polyfill-ctype.git", |
|
1065 |
+ "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4" |
|
1066 |
+ }, |
|
1067 |
+ "dist": { |
|
1068 |
+ "type": "zip", |
|
1069 |
+ "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ef4d7e442ca910c4764bce785146269b30cb5fc4", |
|
1070 |
+ "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4", |
|
1071 |
+ "shasum": "" |
|
1072 |
+ }, |
|
1073 |
+ "require": { |
|
1074 |
+ "php": ">=7.1" |
|
1075 |
+ }, |
|
1076 |
+ "provide": { |
|
1077 |
+ "ext-ctype": "*" |
|
1078 |
+ }, |
|
1079 |
+ "suggest": { |
|
1080 |
+ "ext-ctype": "For best performance" |
|
1081 |
+ }, |
|
1082 |
+ "default-branch": true, |
|
1083 |
+ "type": "library", |
|
1084 |
+ "extra": { |
|
1085 |
+ "thanks": { |
|
1086 |
+ "name": "symfony/polyfill", |
|
1087 |
+ "url": "https://github.com/symfony/polyfill" |
|
1088 |
+ } |
|
1089 |
+ }, |
|
1090 |
+ "autoload": { |
|
1091 |
+ "files": [ |
|
1092 |
+ "bootstrap.php" |
|
1093 |
+ ], |
|
1094 |
+ "psr-4": { |
|
1095 |
+ "Symfony\\Polyfill\\Ctype\\": "" |
|
1096 |
+ } |
|
1097 |
+ }, |
|
1098 |
+ "notification-url": "https://packagist.org/downloads/", |
|
1099 |
+ "license": [ |
|
1100 |
+ "MIT" |
|
1101 |
+ ], |
|
1102 |
+ "authors": [ |
|
1103 |
+ { |
|
1104 |
+ "name": "Gert de Pagter", |
|
1105 |
+ "email": "BackEndTea@gmail.com" |
|
1106 |
+ }, |
|
1107 |
+ { |
|
1108 |
+ "name": "Symfony Community", |
|
1109 |
+ "homepage": "https://symfony.com/contributors" |
|
1110 |
+ } |
|
1111 |
+ ], |
|
1112 |
+ "description": "Symfony polyfill for ctype functions", |
|
1113 |
+ "homepage": "https://symfony.com", |
|
1114 |
+ "keywords": [ |
|
1115 |
+ "compatibility", |
|
1116 |
+ "ctype", |
|
1117 |
+ "polyfill", |
|
1118 |
+ "portable" |
|
1119 |
+ ], |
|
1120 |
+ "support": { |
|
1121 |
+ "source": "https://github.com/symfony/polyfill-ctype/tree/1.x" |
|
1122 |
+ }, |
|
1123 |
+ "funding": [ |
|
1124 |
+ { |
|
1125 |
+ "url": "https://symfony.com/sponsor", |
|
1126 |
+ "type": "custom" |
|
1127 |
+ }, |
|
1128 |
+ { |
|
1129 |
+ "url": "https://github.com/fabpot", |
|
1130 |
+ "type": "github" |
|
1131 |
+ }, |
|
1132 |
+ { |
|
1133 |
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", |
|
1134 |
+ "type": "tidelift" |
|
1135 |
+ } |
|
1136 |
+ ], |
|
1137 |
+ "time": "2024-01-29T20:11:03+00:00" |
|
1138 |
+ }, |
|
1139 |
+ { |
|
1140 |
+ "name": "symfony/polyfill-intl-grapheme", |
|
1141 |
+ "version": "1.x-dev", |
|
1142 |
+ "source": { |
|
1143 |
+ "type": "git", |
|
1144 |
+ "url": "https://github.com/symfony/polyfill-intl-grapheme.git", |
|
1145 |
+ "reference": "32a9da87d7b3245e09ac426c83d334ae9f06f80f" |
|
1146 |
+ }, |
|
1147 |
+ "dist": { |
|
1148 |
+ "type": "zip", |
|
1149 |
+ "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/32a9da87d7b3245e09ac426c83d334ae9f06f80f", |
|
1150 |
+ "reference": "32a9da87d7b3245e09ac426c83d334ae9f06f80f", |
|
1151 |
+ "shasum": "" |
|
1152 |
+ }, |
|
1153 |
+ "require": { |
|
1154 |
+ "php": ">=7.1" |
|
1155 |
+ }, |
|
1156 |
+ "suggest": { |
|
1157 |
+ "ext-intl": "For best performance" |
|
1158 |
+ }, |
|
1159 |
+ "default-branch": true, |
|
1160 |
+ "type": "library", |
|
1161 |
+ "extra": { |
|
1162 |
+ "thanks": { |
|
1163 |
+ "name": "symfony/polyfill", |
|
1164 |
+ "url": "https://github.com/symfony/polyfill" |
|
1165 |
+ } |
|
1166 |
+ }, |
|
1167 |
+ "autoload": { |
|
1168 |
+ "files": [ |
|
1169 |
+ "bootstrap.php" |
|
1170 |
+ ], |
|
1171 |
+ "psr-4": { |
|
1172 |
+ "Symfony\\Polyfill\\Intl\\Grapheme\\": "" |
|
1173 |
+ } |
|
1174 |
+ }, |
|
1175 |
+ "notification-url": "https://packagist.org/downloads/", |
|
1176 |
+ "license": [ |
|
1177 |
+ "MIT" |
|
1178 |
+ ], |
|
1179 |
+ "authors": [ |
|
1180 |
+ { |
|
1181 |
+ "name": "Nicolas Grekas", |
|
1182 |
+ "email": "p@tchwork.com" |
|
1183 |
+ }, |
|
1184 |
+ { |
|
1185 |
+ "name": "Symfony Community", |
|
1186 |
+ "homepage": "https://symfony.com/contributors" |
|
1187 |
+ } |
|
1188 |
+ ], |
|
1189 |
+ "description": "Symfony polyfill for intl's grapheme_* functions", |
|
1190 |
+ "homepage": "https://symfony.com", |
|
1191 |
+ "keywords": [ |
|
1192 |
+ "compatibility", |
|
1193 |
+ "grapheme", |
|
1194 |
+ "intl", |
|
1195 |
+ "polyfill", |
|
1196 |
+ "portable", |
|
1197 |
+ "shim" |
|
1198 |
+ ], |
|
1199 |
+ "support": { |
|
1200 |
+ "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/1.x" |
|
1201 |
+ }, |
|
1202 |
+ "funding": [ |
|
1203 |
+ { |
|
1204 |
+ "url": "https://symfony.com/sponsor", |
|
1205 |
+ "type": "custom" |
|
1206 |
+ }, |
|
1207 |
+ { |
|
1208 |
+ "url": "https://github.com/fabpot", |
|
1209 |
+ "type": "github" |
|
1210 |
+ }, |
|
1211 |
+ { |
|
1212 |
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", |
|
1213 |
+ "type": "tidelift" |
|
1214 |
+ } |
|
1215 |
+ ], |
|
1216 |
+ "time": "2024-01-29T20:11:03+00:00" |
|
1217 |
+ }, |
|
1218 |
+ { |
|
1219 |
+ "name": "symfony/polyfill-intl-normalizer", |
|
1220 |
+ "version": "1.x-dev", |
|
1221 |
+ "source": { |
|
1222 |
+ "type": "git", |
|
1223 |
+ "url": "https://github.com/symfony/polyfill-intl-normalizer.git", |
|
1224 |
+ "reference": "bc45c394692b948b4d383a08d7753968bed9a83d" |
|
1225 |
+ }, |
|
1226 |
+ "dist": { |
|
1227 |
+ "type": "zip", |
|
1228 |
+ "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/bc45c394692b948b4d383a08d7753968bed9a83d", |
|
1229 |
+ "reference": "bc45c394692b948b4d383a08d7753968bed9a83d", |
|
1230 |
+ "shasum": "" |
|
1231 |
+ }, |
|
1232 |
+ "require": { |
|
1233 |
+ "php": ">=7.1" |
|
1234 |
+ }, |
|
1235 |
+ "suggest": { |
|
1236 |
+ "ext-intl": "For best performance" |
|
1237 |
+ }, |
|
1238 |
+ "default-branch": true, |
|
1239 |
+ "type": "library", |
|
1240 |
+ "extra": { |
|
1241 |
+ "thanks": { |
|
1242 |
+ "name": "symfony/polyfill", |
|
1243 |
+ "url": "https://github.com/symfony/polyfill" |
|
1244 |
+ } |
|
1245 |
+ }, |
|
1246 |
+ "autoload": { |
|
1247 |
+ "files": [ |
|
1248 |
+ "bootstrap.php" |
|
1249 |
+ ], |
|
1250 |
+ "psr-4": { |
|
1251 |
+ "Symfony\\Polyfill\\Intl\\Normalizer\\": "" |
|
1252 |
+ }, |
|
1253 |
+ "classmap": [ |
|
1254 |
+ "Resources/stubs" |
|
1255 |
+ ] |
|
1256 |
+ }, |
|
1257 |
+ "notification-url": "https://packagist.org/downloads/", |
|
1258 |
+ "license": [ |
|
1259 |
+ "MIT" |
|
1260 |
+ ], |
|
1261 |
+ "authors": [ |
|
1262 |
+ { |
|
1263 |
+ "name": "Nicolas Grekas", |
|
1264 |
+ "email": "p@tchwork.com" |
|
1265 |
+ }, |
|
1266 |
+ { |
|
1267 |
+ "name": "Symfony Community", |
|
1268 |
+ "homepage": "https://symfony.com/contributors" |
|
1269 |
+ } |
|
1270 |
+ ], |
|
1271 |
+ "description": "Symfony polyfill for intl's Normalizer class and related functions", |
|
1272 |
+ "homepage": "https://symfony.com", |
|
1273 |
+ "keywords": [ |
|
1274 |
+ "compatibility", |
|
1275 |
+ "intl", |
|
1276 |
+ "normalizer", |
|
1277 |
+ "polyfill", |
|
1278 |
+ "portable", |
|
1279 |
+ "shim" |
|
1280 |
+ ], |
|
1281 |
+ "support": { |
|
1282 |
+ "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/1.x" |
|
1283 |
+ }, |
|
1284 |
+ "funding": [ |
|
1285 |
+ { |
|
1286 |
+ "url": "https://symfony.com/sponsor", |
|
1287 |
+ "type": "custom" |
|
1288 |
+ }, |
|
1289 |
+ { |
|
1290 |
+ "url": "https://github.com/fabpot", |
|
1291 |
+ "type": "github" |
|
1292 |
+ }, |
|
1293 |
+ { |
|
1294 |
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", |
|
1295 |
+ "type": "tidelift" |
|
1296 |
+ } |
|
1297 |
+ ], |
|
1298 |
+ "time": "2024-01-29T20:11:03+00:00" |
|
1299 |
+ }, |
|
1300 |
+ { |
|
1301 |
+ "name": "symfony/polyfill-mbstring", |
|
1302 |
+ "version": "1.x-dev", |
|
1303 |
+ "source": { |
|
1304 |
+ "type": "git", |
|
1305 |
+ "url": "https://github.com/symfony/polyfill-mbstring.git", |
|
1306 |
+ "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec" |
|
1307 |
+ }, |
|
1308 |
+ "dist": { |
|
1309 |
+ "type": "zip", |
|
1310 |
+ "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9773676c8a1bb1f8d4340a62efe641cf76eda7ec", |
|
1311 |
+ "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec", |
|
1312 |
+ "shasum": "" |
|
1313 |
+ }, |
|
1314 |
+ "require": { |
|
1315 |
+ "php": ">=7.1" |
|
1316 |
+ }, |
|
1317 |
+ "provide": { |
|
1318 |
+ "ext-mbstring": "*" |
|
1319 |
+ }, |
|
1320 |
+ "suggest": { |
|
1321 |
+ "ext-mbstring": "For best performance" |
|
1322 |
+ }, |
|
1323 |
+ "default-branch": true, |
|
1324 |
+ "type": "library", |
|
1325 |
+ "extra": { |
|
1326 |
+ "thanks": { |
|
1327 |
+ "name": "symfony/polyfill", |
|
1328 |
+ "url": "https://github.com/symfony/polyfill" |
|
1329 |
+ } |
|
1330 |
+ }, |
|
1331 |
+ "autoload": { |
|
1332 |
+ "files": [ |
|
1333 |
+ "bootstrap.php" |
|
1334 |
+ ], |
|
1335 |
+ "psr-4": { |
|
1336 |
+ "Symfony\\Polyfill\\Mbstring\\": "" |
|
1337 |
+ } |
|
1338 |
+ }, |
|
1339 |
+ "notification-url": "https://packagist.org/downloads/", |
|
1340 |
+ "license": [ |
|
1341 |
+ "MIT" |
|
1342 |
+ ], |
|
1343 |
+ "authors": [ |
|
1344 |
+ { |
|
1345 |
+ "name": "Nicolas Grekas", |
|
1346 |
+ "email": "p@tchwork.com" |
|
1347 |
+ }, |
|
1348 |
+ { |
|
1349 |
+ "name": "Symfony Community", |
|
1350 |
+ "homepage": "https://symfony.com/contributors" |
|
1351 |
+ } |
|
1352 |
+ ], |
|
1353 |
+ "description": "Symfony polyfill for the Mbstring extension", |
|
1354 |
+ "homepage": "https://symfony.com", |
|
1355 |
+ "keywords": [ |
|
1356 |
+ "compatibility", |
|
1357 |
+ "mbstring", |
|
1358 |
+ "polyfill", |
|
1359 |
+ "portable", |
|
1360 |
+ "shim" |
|
1361 |
+ ], |
|
1362 |
+ "support": { |
|
1363 |
+ "source": "https://github.com/symfony/polyfill-mbstring/tree/1.x" |
|
1364 |
+ }, |
|
1365 |
+ "funding": [ |
|
1366 |
+ { |
|
1367 |
+ "url": "https://symfony.com/sponsor", |
|
1368 |
+ "type": "custom" |
|
1369 |
+ }, |
|
1370 |
+ { |
|
1371 |
+ "url": "https://github.com/fabpot", |
|
1372 |
+ "type": "github" |
|
1373 |
+ }, |
|
1374 |
+ { |
|
1375 |
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", |
|
1376 |
+ "type": "tidelift" |
|
1377 |
+ } |
|
1378 |
+ ], |
|
1379 |
+ "time": "2024-01-29T20:11:03+00:00" |
|
1380 |
+ }, |
|
1381 |
+ { |
|
1382 |
+ "name": "symfony/polyfill-php80", |
|
1383 |
+ "version": "1.x-dev", |
|
1384 |
+ "source": { |
|
1385 |
+ "type": "git", |
|
1386 |
+ "url": "https://github.com/symfony/polyfill-php80.git", |
|
1387 |
+ "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b" |
|
1388 |
+ }, |
|
1389 |
+ "dist": { |
|
1390 |
+ "type": "zip", |
|
1391 |
+ "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", |
|
1392 |
+ "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", |
|
1393 |
+ "shasum": "" |
|
1394 |
+ }, |
|
1395 |
+ "require": { |
|
1396 |
+ "php": ">=7.1" |
|
1397 |
+ }, |
|
1398 |
+ "default-branch": true, |
|
1399 |
+ "type": "library", |
|
1400 |
+ "extra": { |
|
1401 |
+ "thanks": { |
|
1402 |
+ "name": "symfony/polyfill", |
|
1403 |
+ "url": "https://github.com/symfony/polyfill" |
|
1404 |
+ } |
|
1405 |
+ }, |
|
1406 |
+ "autoload": { |
|
1407 |
+ "files": [ |
|
1408 |
+ "bootstrap.php" |
|
1409 |
+ ], |
|
1410 |
+ "psr-4": { |
|
1411 |
+ "Symfony\\Polyfill\\Php80\\": "" |
|
1412 |
+ }, |
|
1413 |
+ "classmap": [ |
|
1414 |
+ "Resources/stubs" |
|
1415 |
+ ] |
|
1416 |
+ }, |
|
1417 |
+ "notification-url": "https://packagist.org/downloads/", |
|
1418 |
+ "license": [ |
|
1419 |
+ "MIT" |
|
1420 |
+ ], |
|
1421 |
+ "authors": [ |
|
1422 |
+ { |
|
1423 |
+ "name": "Ion Bazan", |
|
1424 |
+ "email": "ion.bazan@gmail.com" |
|
1425 |
+ }, |
|
1426 |
+ { |
|
1427 |
+ "name": "Nicolas Grekas", |
|
1428 |
+ "email": "p@tchwork.com" |
|
1429 |
+ }, |
|
1430 |
+ { |
|
1431 |
+ "name": "Symfony Community", |
|
1432 |
+ "homepage": "https://symfony.com/contributors" |
|
1433 |
+ } |
|
1434 |
+ ], |
|
1435 |
+ "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", |
|
1436 |
+ "homepage": "https://symfony.com", |
|
1437 |
+ "keywords": [ |
|
1438 |
+ "compatibility", |
|
1439 |
+ "polyfill", |
|
1440 |
+ "portable", |
|
1441 |
+ "shim" |
|
1442 |
+ ], |
|
1443 |
+ "support": { |
|
1444 |
+ "source": "https://github.com/symfony/polyfill-php80/tree/1.x" |
|
1445 |
+ }, |
|
1446 |
+ "funding": [ |
|
1447 |
+ { |
|
1448 |
+ "url": "https://symfony.com/sponsor", |
|
1449 |
+ "type": "custom" |
|
1450 |
+ }, |
|
1451 |
+ { |
|
1452 |
+ "url": "https://github.com/fabpot", |
|
1453 |
+ "type": "github" |
|
1454 |
+ }, |
|
1455 |
+ { |
|
1456 |
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", |
|
1457 |
+ "type": "tidelift" |
|
1458 |
+ } |
|
1459 |
+ ], |
|
1460 |
+ "time": "2024-01-29T20:11:03+00:00" |
|
1461 |
+ }, |
|
1462 |
+ { |
|
1463 |
+ "name": "symfony/polyfill-php81", |
|
1464 |
+ "version": "1.x-dev", |
|
1465 |
+ "source": { |
|
1466 |
+ "type": "git", |
|
1467 |
+ "url": "https://github.com/symfony/polyfill-php81.git", |
|
1468 |
+ "reference": "c565ad1e63f30e7477fc40738343c62b40bc672d" |
|
1469 |
+ }, |
|
1470 |
+ "dist": { |
|
1471 |
+ "type": "zip", |
|
1472 |
+ "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/c565ad1e63f30e7477fc40738343c62b40bc672d", |
|
1473 |
+ "reference": "c565ad1e63f30e7477fc40738343c62b40bc672d", |
|
1474 |
+ "shasum": "" |
|
1475 |
+ }, |
|
1476 |
+ "require": { |
|
1477 |
+ "php": ">=7.1" |
|
1478 |
+ }, |
|
1479 |
+ "default-branch": true, |
|
1480 |
+ "type": "library", |
|
1481 |
+ "extra": { |
|
1482 |
+ "thanks": { |
|
1483 |
+ "name": "symfony/polyfill", |
|
1484 |
+ "url": "https://github.com/symfony/polyfill" |
|
1485 |
+ } |
|
1486 |
+ }, |
|
1487 |
+ "autoload": { |
|
1488 |
+ "files": [ |
|
1489 |
+ "bootstrap.php" |
|
1490 |
+ ], |
|
1491 |
+ "psr-4": { |
|
1492 |
+ "Symfony\\Polyfill\\Php81\\": "" |
|
1493 |
+ }, |
|
1494 |
+ "classmap": [ |
|
1495 |
+ "Resources/stubs" |
|
1496 |
+ ] |
|
1497 |
+ }, |
|
1498 |
+ "notification-url": "https://packagist.org/downloads/", |
|
1499 |
+ "license": [ |
|
1500 |
+ "MIT" |
|
1501 |
+ ], |
|
1502 |
+ "authors": [ |
|
1503 |
+ { |
|
1504 |
+ "name": "Nicolas Grekas", |
|
1505 |
+ "email": "p@tchwork.com" |
|
1506 |
+ }, |
|
1507 |
+ { |
|
1508 |
+ "name": "Symfony Community", |
|
1509 |
+ "homepage": "https://symfony.com/contributors" |
|
1510 |
+ } |
|
1511 |
+ ], |
|
1512 |
+ "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", |
|
1513 |
+ "homepage": "https://symfony.com", |
|
1514 |
+ "keywords": [ |
|
1515 |
+ "compatibility", |
|
1516 |
+ "polyfill", |
|
1517 |
+ "portable", |
|
1518 |
+ "shim" |
|
1519 |
+ ], |
|
1520 |
+ "support": { |
|
1521 |
+ "source": "https://github.com/symfony/polyfill-php81/tree/1.x" |
|
1522 |
+ }, |
|
1523 |
+ "funding": [ |
|
1524 |
+ { |
|
1525 |
+ "url": "https://symfony.com/sponsor", |
|
1526 |
+ "type": "custom" |
|
1527 |
+ }, |
|
1528 |
+ { |
|
1529 |
+ "url": "https://github.com/fabpot", |
|
1530 |
+ "type": "github" |
|
1531 |
+ }, |
|
1532 |
+ { |
|
1533 |
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", |
|
1534 |
+ "type": "tidelift" |
|
1535 |
+ } |
|
1536 |
+ ], |
|
1537 |
+ "time": "2024-01-29T20:11:03+00:00" |
|
1538 |
+ }, |
|
1539 |
+ { |
|
1540 |
+ "name": "symfony/process", |
|
1541 |
+ "version": "7.1.x-dev", |
|
1542 |
+ "source": { |
|
1543 |
+ "type": "git", |
|
1544 |
+ "url": "https://github.com/symfony/process.git", |
|
1545 |
+ "reference": "bf2a95a35479a194ad59d1f3458245fb6fb291a6" |
|
1546 |
+ }, |
|
1547 |
+ "dist": { |
|
1548 |
+ "type": "zip", |
|
1549 |
+ "url": "https://api.github.com/repos/symfony/process/zipball/bf2a95a35479a194ad59d1f3458245fb6fb291a6", |
|
1550 |
+ "reference": "bf2a95a35479a194ad59d1f3458245fb6fb291a6", |
|
1551 |
+ "shasum": "" |
|
1552 |
+ }, |
|
1553 |
+ "require": { |
|
1554 |
+ "php": ">=8.2" |
|
1555 |
+ }, |
|
1556 |
+ "type": "library", |
|
1557 |
+ "autoload": { |
|
1558 |
+ "psr-4": { |
|
1559 |
+ "Symfony\\Component\\Process\\": "" |
|
1560 |
+ }, |
|
1561 |
+ "exclude-from-classmap": [ |
|
1562 |
+ "/Tests/" |
|
1563 |
+ ] |
|
1564 |
+ }, |
|
1565 |
+ "notification-url": "https://packagist.org/downloads/", |
|
1566 |
+ "license": [ |
|
1567 |
+ "MIT" |
|
1568 |
+ ], |
|
1569 |
+ "authors": [ |
|
1570 |
+ { |
|
1571 |
+ "name": "Fabien Potencier", |
|
1572 |
+ "email": "fabien@symfony.com" |
|
1573 |
+ }, |
|
1574 |
+ { |
|
1575 |
+ "name": "Symfony Community", |
|
1576 |
+ "homepage": "https://symfony.com/contributors" |
|
1577 |
+ } |
|
1578 |
+ ], |
|
1579 |
+ "description": "Executes commands in sub-processes", |
|
1580 |
+ "homepage": "https://symfony.com", |
|
1581 |
+ "support": { |
|
1582 |
+ "source": "https://github.com/symfony/process/tree/7.1" |
|
1583 |
+ }, |
|
1584 |
+ "funding": [ |
|
1585 |
+ { |
|
1586 |
+ "url": "https://symfony.com/sponsor", |
|
1587 |
+ "type": "custom" |
|
1588 |
+ }, |
|
1589 |
+ { |
|
1590 |
+ "url": "https://github.com/fabpot", |
|
1591 |
+ "type": "github" |
|
1592 |
+ }, |
|
1593 |
+ { |
|
1594 |
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", |
|
1595 |
+ "type": "tidelift" |
|
1596 |
+ } |
|
1597 |
+ ], |
|
1598 |
+ "time": "2024-01-23T15:06:13+00:00" |
|
1599 |
+ }, |
|
1600 |
+ { |
|
1601 |
+ "name": "symfony/service-contracts", |
|
1602 |
+ "version": "dev-main", |
|
1603 |
+ "source": { |
|
1604 |
+ "type": "git", |
|
1605 |
+ "url": "https://github.com/symfony/service-contracts.git", |
|
1606 |
+ "reference": "cea2eccfcd27ac3deb252bd67f78b9b8ffc4da84" |
|
1607 |
+ }, |
|
1608 |
+ "dist": { |
|
1609 |
+ "type": "zip", |
|
1610 |
+ "url": "https://api.github.com/repos/symfony/service-contracts/zipball/cea2eccfcd27ac3deb252bd67f78b9b8ffc4da84", |
|
1611 |
+ "reference": "cea2eccfcd27ac3deb252bd67f78b9b8ffc4da84", |
|
1612 |
+ "shasum": "" |
|
1613 |
+ }, |
|
1614 |
+ "require": { |
|
1615 |
+ "php": ">=8.1", |
|
1616 |
+ "psr/container": "^1.1|^2.0" |
|
1617 |
+ }, |
|
1618 |
+ "conflict": { |
|
1619 |
+ "ext-psr": "<1.1|>=2" |
|
1620 |
+ }, |
|
1621 |
+ "default-branch": true, |
|
1622 |
+ "type": "library", |
|
1623 |
+ "extra": { |
|
1624 |
+ "branch-alias": { |
|
1625 |
+ "dev-main": "3.5-dev" |
|
1626 |
+ }, |
|
1627 |
+ "thanks": { |
|
1628 |
+ "name": "symfony/contracts", |
|
1629 |
+ "url": "https://github.com/symfony/contracts" |
|
1630 |
+ } |
|
1631 |
+ }, |
|
1632 |
+ "autoload": { |
|
1633 |
+ "psr-4": { |
|
1634 |
+ "Symfony\\Contracts\\Service\\": "" |
|
1635 |
+ }, |
|
1636 |
+ "exclude-from-classmap": [ |
|
1637 |
+ "/Test/" |
|
1638 |
+ ] |
|
1639 |
+ }, |
|
1640 |
+ "notification-url": "https://packagist.org/downloads/", |
|
1641 |
+ "license": [ |
|
1642 |
+ "MIT" |
|
1643 |
+ ], |
|
1644 |
+ "authors": [ |
|
1645 |
+ { |
|
1646 |
+ "name": "Nicolas Grekas", |
|
1647 |
+ "email": "p@tchwork.com" |
|
1648 |
+ }, |
|
1649 |
+ { |
|
1650 |
+ "name": "Symfony Community", |
|
1651 |
+ "homepage": "https://symfony.com/contributors" |
|
1652 |
+ } |
|
1653 |
+ ], |
|
1654 |
+ "description": "Generic abstractions related to writing services", |
|
1655 |
+ "homepage": "https://symfony.com", |
|
1656 |
+ "keywords": [ |
|
1657 |
+ "abstractions", |
|
1658 |
+ "contracts", |
|
1659 |
+ "decoupling", |
|
1660 |
+ "interfaces", |
|
1661 |
+ "interoperability", |
|
1662 |
+ "standards" |
|
1663 |
+ ], |
|
1664 |
+ "support": { |
|
1665 |
+ "source": "https://github.com/symfony/service-contracts/tree/main" |
|
1666 |
+ }, |
|
1667 |
+ "funding": [ |
|
1668 |
+ { |
|
1669 |
+ "url": "https://symfony.com/sponsor", |
|
1670 |
+ "type": "custom" |
|
1671 |
+ }, |
|
1672 |
+ { |
|
1673 |
+ "url": "https://github.com/fabpot", |
|
1674 |
+ "type": "github" |
|
1675 |
+ }, |
|
1676 |
+ { |
|
1677 |
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", |
|
1678 |
+ "type": "tidelift" |
|
1679 |
+ } |
|
1680 |
+ ], |
|
1681 |
+ "time": "2024-01-02T14:07:37+00:00" |
|
1682 |
+ }, |
|
1683 |
+ { |
|
1684 |
+ "name": "symfony/stopwatch", |
|
1685 |
+ "version": "7.1.x-dev", |
|
1686 |
+ "source": { |
|
1687 |
+ "type": "git", |
|
1688 |
+ "url": "https://github.com/symfony/stopwatch.git", |
|
1689 |
+ "reference": "7adecaad199762c969faf635c8e9a13034fac71e" |
|
1690 |
+ }, |
|
1691 |
+ "dist": { |
|
1692 |
+ "type": "zip", |
|
1693 |
+ "url": "https://api.github.com/repos/symfony/stopwatch/zipball/7adecaad199762c969faf635c8e9a13034fac71e", |
|
1694 |
+ "reference": "7adecaad199762c969faf635c8e9a13034fac71e", |
|
1695 |
+ "shasum": "" |
|
1696 |
+ }, |
|
1697 |
+ "require": { |
|
1698 |
+ "php": ">=8.2", |
|
1699 |
+ "symfony/service-contracts": "^2.5|^3" |
|
1700 |
+ }, |
|
1701 |
+ "type": "library", |
|
1702 |
+ "autoload": { |
|
1703 |
+ "psr-4": { |
|
1704 |
+ "Symfony\\Component\\Stopwatch\\": "" |
|
1705 |
+ }, |
|
1706 |
+ "exclude-from-classmap": [ |
|
1707 |
+ "/Tests/" |
|
1708 |
+ ] |
|
1709 |
+ }, |
|
1710 |
+ "notification-url": "https://packagist.org/downloads/", |
|
1711 |
+ "license": [ |
|
1712 |
+ "MIT" |
|
1713 |
+ ], |
|
1714 |
+ "authors": [ |
|
1715 |
+ { |
|
1716 |
+ "name": "Fabien Potencier", |
|
1717 |
+ "email": "fabien@symfony.com" |
|
1718 |
+ }, |
|
1719 |
+ { |
|
1720 |
+ "name": "Symfony Community", |
|
1721 |
+ "homepage": "https://symfony.com/contributors" |
|
1722 |
+ } |
|
1723 |
+ ], |
|
1724 |
+ "description": "Provides a way to profile code", |
|
1725 |
+ "homepage": "https://symfony.com", |
|
1726 |
+ "support": { |
|
1727 |
+ "source": "https://github.com/symfony/stopwatch/tree/7.1" |
|
1728 |
+ }, |
|
1729 |
+ "funding": [ |
|
1730 |
+ { |
|
1731 |
+ "url": "https://symfony.com/sponsor", |
|
1732 |
+ "type": "custom" |
|
1733 |
+ }, |
|
1734 |
+ { |
|
1735 |
+ "url": "https://github.com/fabpot", |
|
1736 |
+ "type": "github" |
|
1737 |
+ }, |
|
1738 |
+ { |
|
1739 |
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", |
|
1740 |
+ "type": "tidelift" |
|
1741 |
+ } |
|
1742 |
+ ], |
|
1743 |
+ "time": "2024-01-23T15:06:13+00:00" |
|
1744 |
+ }, |
|
1745 |
+ { |
|
1746 |
+ "name": "symfony/string", |
|
1747 |
+ "version": "7.1.x-dev", |
|
1748 |
+ "source": { |
|
1749 |
+ "type": "git", |
|
1750 |
+ "url": "https://github.com/symfony/string.git", |
|
1751 |
+ "reference": "3d0a98879bbc7585aff5f9a5a539074328cc2ca0" |
|
1752 |
+ }, |
|
1753 |
+ "dist": { |
|
1754 |
+ "type": "zip", |
|
1755 |
+ "url": "https://api.github.com/repos/symfony/string/zipball/3d0a98879bbc7585aff5f9a5a539074328cc2ca0", |
|
1756 |
+ "reference": "3d0a98879bbc7585aff5f9a5a539074328cc2ca0", |
|
1757 |
+ "shasum": "" |
|
1758 |
+ }, |
|
1759 |
+ "require": { |
|
1760 |
+ "php": ">=8.2", |
|
1761 |
+ "symfony/polyfill-ctype": "~1.8", |
|
1762 |
+ "symfony/polyfill-intl-grapheme": "~1.0", |
|
1763 |
+ "symfony/polyfill-intl-normalizer": "~1.0", |
|
1764 |
+ "symfony/polyfill-mbstring": "~1.0" |
|
1765 |
+ }, |
|
1766 |
+ "conflict": { |
|
1767 |
+ "symfony/translation-contracts": "<2.5" |
|
1768 |
+ }, |
|
1769 |
+ "require-dev": { |
|
1770 |
+ "symfony/emoji": "^7.1", |
|
1771 |
+ "symfony/error-handler": "^6.4|^7.0", |
|
1772 |
+ "symfony/http-client": "^6.4|^7.0", |
|
1773 |
+ "symfony/intl": "^6.4|^7.0", |
|
1774 |
+ "symfony/translation-contracts": "^2.5|^3.0", |
|
1775 |
+ "symfony/var-exporter": "^6.4|^7.0" |
|
1776 |
+ }, |
|
1777 |
+ "type": "library", |
|
1778 |
+ "autoload": { |
|
1779 |
+ "files": [ |
|
1780 |
+ "Resources/functions.php" |
|
1781 |
+ ], |
|
1782 |
+ "psr-4": { |
|
1783 |
+ "Symfony\\Component\\String\\": "" |
|
1784 |
+ }, |
|
1785 |
+ "exclude-from-classmap": [ |
|
1786 |
+ "/Tests/" |
|
1787 |
+ ] |
|
1788 |
+ }, |
|
1789 |
+ "notification-url": "https://packagist.org/downloads/", |
|
1790 |
+ "license": [ |
|
1791 |
+ "MIT" |
|
1792 |
+ ], |
|
1793 |
+ "authors": [ |
|
1794 |
+ { |
|
1795 |
+ "name": "Nicolas Grekas", |
|
1796 |
+ "email": "p@tchwork.com" |
|
1797 |
+ }, |
|
1798 |
+ { |
|
1799 |
+ "name": "Symfony Community", |
|
1800 |
+ "homepage": "https://symfony.com/contributors" |
|
1801 |
+ } |
|
1802 |
+ ], |
|
1803 |
+ "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", |
|
1804 |
+ "homepage": "https://symfony.com", |
|
1805 |
+ "keywords": [ |
|
1806 |
+ "grapheme", |
|
1807 |
+ "i18n", |
|
1808 |
+ "string", |
|
1809 |
+ "unicode", |
|
1810 |
+ "utf-8", |
|
1811 |
+ "utf8" |
|
1812 |
+ ], |
|
1813 |
+ "support": { |
|
1814 |
+ "source": "https://github.com/symfony/string/tree/7.1" |
|
1815 |
+ }, |
|
1816 |
+ "funding": [ |
|
1817 |
+ { |
|
1818 |
+ "url": "https://symfony.com/sponsor", |
|
1819 |
+ "type": "custom" |
|
1820 |
+ }, |
|
1821 |
+ { |
|
1822 |
+ "url": "https://github.com/fabpot", |
|
1823 |
+ "type": "github" |
|
1824 |
+ }, |
|
1825 |
+ { |
|
1826 |
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", |
|
1827 |
+ "type": "tidelift" |
|
1828 |
+ } |
|
1829 |
+ ], |
|
1830 |
+ "time": "2024-02-03T19:41:36+00:00" |
|
1831 |
+ } |
|
1832 |
+ ], |
|
1833 |
+ "packages-dev": [], |
|
1834 |
+ "aliases": [], |
|
1835 |
+ "minimum-stability": "dev", |
|
1836 |
+ "stability-flags": { |
|
1837 |
+ "friendsofphp/php-cs-fixer": 20 |
|
1838 |
+ }, |
|
1839 |
+ "prefer-stable": false, |
|
1840 |
+ "prefer-lowest": false, |
|
1841 |
+ "platform": [], |
|
1842 |
+ "platform-dev": [], |
|
1843 |
+ "plugin-api-version": "2.6.0" |
|
1844 |
+} |
... | ... |
@@ -8,19 +8,21 @@ |
8 | 8 |
*/ |
9 | 9 |
|
10 | 10 |
// If we have found SSI.php and we are outside of SMF, then we are running standalone. |
11 |
-if (file_exists(dirname(__FILE__) . '/SSI.php') && !defined('SMF')) |
|
12 |
- require_once(dirname(__FILE__) . '/SSI.php'); |
|
13 |
-elseif (file_exists(getcwd() . '/SSI.php') && !defined('SMF')) |
|
14 |
- require_once(getcwd() . '/SSI.php'); |
|
15 |
-elseif (!defined('SMF')) // If we are outside SMF and can't find SSI.php, then throw an error |
|
11 |
+if (file_exists(dirname(__FILE__) . '/SSI.php') && !defined('SMF')) { |
|
12 |
+ require_once dirname(__FILE__) . '/SSI.php'; |
|
13 |
+} elseif (file_exists(getcwd() . '/SSI.php') && !defined('SMF')) { |
|
14 |
+ require_once getcwd() . '/SSI.php'; |
|
15 |
+} elseif (!defined('SMF')) { // If we are outside SMF and can't find SSI.php, then throw an error |
|
16 | 16 |
die('<b>Error:</b> Cannot install - please verify you put this file in the same place as SMF\'s SSI.php.'); |
17 |
+} |
|
17 | 18 |
|
18 |
-if (SMF == 'SSI') |
|
19 |
+if (SMF == 'SSI') { |
|
19 | 20 |
db_extend('packages'); |
21 |
+} |
|
20 | 22 |
|
21 |
-$table = array( |
|
23 |
+$table = [ |
|
22 | 24 |
'table_name' => '{db_prefix}log_sfs', |
23 |
- 'columns' => array( |
|
25 |
+ 'columns' => [ |
|
24 | 26 |
db_field('id_sfs', 'int', 0, true, true), |
25 | 27 |
db_field('id_type', 'tinyint', 0), |
26 | 28 |
db_field('log_time', 'int'), |
... | ... |
@@ -32,21 +34,21 @@ $table = array( |
32 | 34 |
db_field('ip2', 'varchar', 255), |
33 | 35 |
db_field('checks', 'mediumtext'), |
34 | 36 |
db_field('result', 'mediumtext'), |
35 |
- ), |
|
36 |
- 'indexes' => array( |
|
37 |
- array( |
|
38 |
- 'columns' => array('id_sfs'), |
|
37 |
+ ], |
|
38 |
+ 'indexes' => [ |
|
39 |
+ [ |
|
40 |
+ 'columns' => ['id_sfs'], |
|
39 | 41 |
'type' => 'primary', |
40 |
- ), |
|
41 |
- array( |
|
42 |
- 'columns' => array('id_type'), |
|
42 |
+ ], |
|
43 |
+ [ |
|
44 |
+ 'columns' => ['id_type'], |
|
43 | 45 |
'type' => 'index', |
44 |
- ), |
|
45 |
- ), |
|
46 |
+ ], |
|
47 |
+ ], |
|
46 | 48 |
'if_exists' => 'ignore', |
47 | 49 |
'error' => 'fatal', |
48 |
- 'parameters' => array(), |
|
49 |
-); |
|
50 |
+ 'parameters' => [], |
|
51 |
+]; |
|
50 | 52 |
|
51 | 53 |
$smcFunc['db_create_table']($table['table_name'], $table['columns'], $table['indexes'], $table['parameters'], $table['if_exists'], $table['error']); |
52 | 54 |
|
... | ... |
@@ -58,7 +60,7 @@ $smcFunc['db_create_table']($table['table_name'], $table['columns'], $table['ind |
58 | 60 |
*/ |
59 | 61 |
function db_field($name, $type, $size = 0, $unsigned = true, $auto = false) |
60 | 62 |
{ |
61 |
- $fields = array( |
|
63 |
+ $fields = [ |
|
62 | 64 |
'varchar' => db_field_varchar($size), |
63 | 65 |
'text' => db_field_text(), |
64 | 66 |
'mediumtext' => db_field_mediumtext(), |
... | ... |
@@ -67,7 +69,7 @@ function db_field($name, $type, $size = 0, $unsigned = true, $auto = false) |
67 | 69 |
'mediumint' => db_field_mediumint($unsigned, $auto), |
68 | 70 |
'int' => db_field_int($unsigned, $auto), |
69 | 71 |
'bigint' => db_field_bigint($unsigned, $auto), |
70 |
- ); |
|
72 |
+ ]; |
|
71 | 73 |
|
72 | 74 |
$field = $fields[$type]; |
73 | 75 |
$field['name'] = $name; |
... | ... |
@@ -83,12 +85,12 @@ function db_field($name, $type, $size = 0, $unsigned = true, $auto = false) |
83 | 85 |
*/ |
84 | 86 |
function db_field_varchar($size = 0) |
85 | 87 |
{ |
86 |
- return array( |
|
88 |
+ return [ |
|
87 | 89 |
'auto' => false, |
88 | 90 |
'type' => 'varchar', |
89 | 91 |
'size' => $size == 0 ? 50 : $size, |
90 | 92 |
'null' => false, |
91 |
- ); |
|
93 |
+ ]; |
|
92 | 94 |
} |
93 | 95 |
|
94 | 96 |
/* |
... | ... |
@@ -99,11 +101,11 @@ function db_field_varchar($size = 0) |
99 | 101 |
*/ |
100 | 102 |
function db_field_text() |
101 | 103 |
{ |
102 |
- return array( |
|
104 |
+ return [ |
|
103 | 105 |
'auto' => false, |
104 | 106 |
'type' => 'text', |
105 | 107 |
'null' => false, |
106 |
- ); |
|
108 |
+ ]; |
|
107 | 109 |
} |
108 | 110 |
|
109 | 111 |
/* |
... | ... |
@@ -114,11 +116,11 @@ function db_field_text() |
114 | 116 |
*/ |
115 | 117 |
function db_field_mediumtext() |
116 | 118 |
{ |
117 |
- return array( |
|
119 |
+ return [ |
|
118 | 120 |
'auto' => false, |
119 | 121 |
'type' => 'mediumtext', |
120 | 122 |
'null' => false, |
121 |
- ); |
|
123 |
+ ]; |
|
122 | 124 |
} |
123 | 125 |
|
124 | 126 |
/* |
... | ... |
@@ -129,14 +131,14 @@ function db_field_mediumtext() |
129 | 131 |
*/ |
130 | 132 |
function db_field_tinyint($unsigned = true, $auto = false) |
131 | 133 |
{ |
132 |
- return array( |
|
134 |
+ return [ |
|
133 | 135 |
'auto' => $auto, |
134 | 136 |
'type' => 'tinyint', |
135 | 137 |
'default' => 0, |
136 | 138 |
'size' => empty($unsigned) ? 4 : 3, |
137 | 139 |
'unsigned' => $unsigned, |
138 | 140 |
'null' => false, |
139 |
- ); |
|
141 |
+ ]; |
|
140 | 142 |
} |
141 | 143 |
|
142 | 144 |
/* |
... | ... |
@@ -147,14 +149,14 @@ function db_field_tinyint($unsigned = true, $auto = false) |
147 | 149 |
*/ |
148 | 150 |
function db_field_smallint($unsigned = true, $auto = false) |
149 | 151 |
{ |
150 |
- return array( |
|
152 |
+ return [ |
|
151 | 153 |
'auto' => $auto, |
152 | 154 |
'type' => 'smallint', |
153 | 155 |
'default' => 0, |
154 | 156 |
'size' => empty($unsigned) ? 6 : 5, |
155 | 157 |
'unsigned' => $unsigned, |
156 | 158 |
'null' => false, |
157 |
- ); |
|
159 |
+ ]; |
|
158 | 160 |
} |
159 | 161 |
|
160 | 162 |
/* |
... | ... |
@@ -165,14 +167,14 @@ function db_field_smallint($unsigned = true, $auto = false) |
165 | 167 |
*/ |
166 | 168 |
function db_field_mediumint($unsigned = true, $auto = false) |
167 | 169 |
{ |
168 |
- return array( |
|
170 |
+ return [ |
|
169 | 171 |
'auto' => $auto, |
170 | 172 |
'type' => 'mediumint', |
171 | 173 |
'default' => 0, |
172 | 174 |
'size' => 8, |
173 | 175 |
'unsigned' => $unsigned, |
174 | 176 |
'null' => false, |
175 |
- ); |
|
177 |
+ ]; |
|
176 | 178 |
} |
177 | 179 |
|
178 | 180 |
/* |
... | ... |
@@ -183,14 +185,14 @@ function db_field_mediumint($unsigned = true, $auto = false) |
183 | 185 |
*/ |
184 | 186 |
function db_field_int($unsigned = true, $auto = false) |
185 | 187 |
{ |
186 |
- return array( |
|
188 |
+ return [ |
|
187 | 189 |
'auto' => $auto, |
188 | 190 |
'type' => 'int', |
189 | 191 |
'default' => 0, |
190 | 192 |
'size' => empty($unsigned) ? 11 : 10, |
191 | 193 |
'unsigned' => $unsigned, |
192 | 194 |
'null' => false, |
193 |
- ); |
|
195 |
+ ]; |
|
194 | 196 |
} |
195 | 197 |
|
196 | 198 |
/* |
... | ... |
@@ -201,12 +203,12 @@ function db_field_int($unsigned = true, $auto = false) |
201 | 203 |
*/ |
202 | 204 |
function db_field_bigint($unsigned = true, $auto = false) |
203 | 205 |
{ |
204 |
- return array( |
|
206 |
+ return [ |
|
205 | 207 |
'auto' => $auto, |
206 | 208 |
'type' => 'bigint', |
207 | 209 |
'default' => 0, |
208 | 210 |
'size' => 21, |
209 | 211 |
'unsigned' => $unsigned, |
210 | 212 |
'null' => false, |
211 |
- ); |
|
213 |
+ ]; |
|
212 | 214 |
} |
... | ... |
@@ -3,7 +3,7 @@ |
3 | 3 |
<package-info xmlns="http://www.simplemachines.org/xml/package-info" xmlns:smf="http://www.simplemachines.org/"> |
4 | 4 |
<id>SleePy:StopForumSpam</id> |
5 | 5 |
<name>Stop Forum Spam</name> |
6 |
- <version>1.5.3</version> |
|
6 |
+ <version>1.5.4</version> |
|
7 | 7 |
<type>modification</type> |
8 | 8 |
|
9 | 9 |
<!-- 2.0 has no support for hooks --> |
... | ... |
@@ -121,7 +121,7 @@ |
121 | 121 |
<remove-file name="$themedir/images/admin/sfs.webp" /> |
122 | 122 |
</uninstall> |
123 | 123 |
|
124 |
- <upgrade from="1.0-1.5.2" for="2.1.*"> |
|
124 |
+ <upgrade from="1.0-1.5.3" for="2.1.*"> |
|
125 | 125 |
<require-file name="language/StopForumSpam.english.php" destination="$themes_dir/default/languages" /> |
126 | 126 |
<require-file name="language/StopForumSpam.finnish.php" destination="$themes_dir/default/languages" /> |
127 | 127 |
|
... | ... |
@@ -154,7 +154,7 @@ |
154 | 154 |
<require-file name="sfs.webp" destination="$themedir/images/admin" /> |
155 | 155 |
</upgrade> |
156 | 156 |
|
157 |
- <upgrade from="1.0-1.5.2" for="2.0.*"> |
|
157 |
+ <upgrade from="1.0-1.5.3" for="2.0.*"> |
|
158 | 158 |
<code type="file">sfs_hooks_install.php</code> |
159 | 159 |
|
160 | 160 |
<require-file name="language/StopForumSpam.english.php" destination="$themes_dir/default/languages" /> |
... | ... |
@@ -8,15 +8,17 @@ |
8 | 8 |
*/ |
9 | 9 |
|
10 | 10 |
// If we have found SSI.php and we are outside of SMF, then we are running standalone. |
11 |
-if (file_exists(dirname(__FILE__) . '/SSI.php') && !defined('SMF')) |
|
12 |
- require_once(dirname(__FILE__) . '/SSI.php'); |
|
13 |
-elseif (file_exists(getcwd() . '/SSI.php') && !defined('SMF')) |
|
14 |
- require_once(getcwd() . '/SSI.php'); |
|
15 |
-elseif (!defined('SMF')) // If we are outside SMF and can't find SSI.php, then throw an error |
|
11 |
+if (file_exists(dirname(__FILE__) . '/SSI.php') && !defined('SMF')) { |
|
12 |
+ require_once dirname(__FILE__) . '/SSI.php'; |
|
13 |
+} elseif (file_exists(getcwd() . '/SSI.php') && !defined('SMF')) { |
|
14 |
+ require_once getcwd() . '/SSI.php'; |
|
15 |
+} elseif (!defined('SMF')) { // If we are outside SMF and can't find SSI.php, then throw an error |
|
16 | 16 |
die('<b>Error:</b> Cannot install - please verify you put this file in the same place as SMF\'s SSI.php.'); |
17 |
+} |
|
17 | 18 |
|
18 |
-if (SMF == 'SSI') |
|
19 |
+if (SMF == 'SSI') { |
|
19 | 20 |
db_extend('packages'); |
21 |
+} |
|
20 | 22 |
|
21 | 23 |
$hooks = [ |
22 | 24 |
// Main sections. |
... | ... |
@@ -31,17 +33,21 @@ $hooks = [ |
31 | 33 |
'integrate_manage_logs' => 'SFSL::hook_manage_logs', |
32 | 34 |
|
33 | 35 |
// Profile Section. |
34 |
- 'integrate_profile_areas' => 'SFSP::hook_pre_profile_areas' |
|
36 |
+ 'integrate_profile_areas' => 'SFSP::hook_pre_profile_areas', |
|
35 | 37 |
]; |
36 |
-foreach ($hooks as $hook => $func) |
|
38 |
+ |
|
39 |
+foreach ($hooks as $hook => $func) { |
|
37 | 40 |
add_integration_function($hook, $func, true); |
41 |
+} |
|
38 | 42 |
|
39 | 43 |
// Remove old hooks. |
40 | 44 |
$removeHooks = [ |
41 | 45 |
['integrate_manage_logs', 'SFSA::hook_manage_logs'], |
42 | 46 |
['integrate_pre_include', '$sourcedir/SFS.php'], |
43 | 47 |
['integrate_admin_include', '$sourcedir/SFS-Subs-Admin.php'], |
44 |
- ['integrate_profile_areas','SFS::hook_pre_profile_areas'] |
|
48 |
+ ['integrate_profile_areas', 'SFS::hook_pre_profile_areas'], |
|
45 | 49 |
]; |
46 |
-foreach ($removeHooks as $remove) |
|
50 |
+ |
|
51 |
+foreach ($removeHooks as $remove) { |
|
47 | 52 |
remove_integration_function($remove[0], $remove[1]); |
53 |
+} |
... | ... |
@@ -8,15 +8,17 @@ |
8 | 8 |
*/ |
9 | 9 |
|
10 | 10 |
// If we have found SSI.php and we are outside of SMF, then we are running standalone. |
11 |
-if (file_exists(dirname(__FILE__) . '/SSI.php') && !defined('SMF')) |
|
12 |
- require_once(dirname(__FILE__) . '/SSI.php'); |
|
13 |
-elseif (file_exists(getcwd() . '/SSI.php') && !defined('SMF')) |
|
14 |
- require_once(getcwd() . '/SSI.php'); |
|
15 |
-elseif (!defined('SMF')) // If we are outside SMF and can't find SSI.php, then throw an error |
|
11 |
+if (file_exists(dirname(__FILE__) . '/SSI.php') && !defined('SMF')) { |
|
12 |
+ require_once dirname(__FILE__) . '/SSI.php'; |
|
13 |
+} elseif (file_exists(getcwd() . '/SSI.php') && !defined('SMF')) { |
|
14 |
+ require_once getcwd() . '/SSI.php'; |
|
15 |
+} elseif (!defined('SMF')) { // If we are outside SMF and can't find SSI.php, then throw an error |
|
16 | 16 |
die('<b>Error:</b> Cannot install - please verify you put this file in the same place as SMF\'s SSI.php.'); |
17 |
+} |
|
17 | 18 |
|
18 |
-if (SMF == 'SSI') |
|
19 |
+if (SMF == 'SSI') { |
|
19 | 20 |
db_extend('packages'); |
21 |
+} |
|
20 | 22 |
|
21 | 23 |
$hooks = [ |
22 | 24 |
// Main sections. |
... | ... |
@@ -31,8 +33,9 @@ $hooks = [ |
31 | 33 |
'integrate_manage_logs' => 'SFSL::hook_manage_logs', |
32 | 34 |
|
33 | 35 |
// Profile Section. |
34 |
- 'integrate_profile_areas' => 'SFSP::hook_pre_profile_areas' |
|
36 |
+ 'integrate_profile_areas' => 'SFSP::hook_pre_profile_areas', |
|
35 | 37 |
]; |
36 | 38 |
|
37 |
-foreach ($hooks as $hook => $func) |
|
39 |
+foreach ($hooks as $hook => $func) { |
|
38 | 40 |
remove_integration_function($hook, $func); |
41 |
+} |
|
39 | 42 |