Skip to content

Commit 8034723

Browse files
Merge pull request #46 from Sesquipedalian/composer_updates
Composer updates
2 parents d75973c + f57dbfb commit 8034723

4 files changed

Lines changed: 46 additions & 42 deletions

File tree

check-eof.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
*
66
* @package SMF
77
* @author Simple Machines https://www.simplemachines.org
8-
* @copyright 2022 Simple Machines and individual contributors
8+
* @copyright 2025 Simple Machines and individual contributors
99
* @license https://www.simplemachines.org/about/smf/license.php BSD
1010
*
11-
* @version 2.1.0
11+
* @version 3.0 Alpha 4
1212
*/
1313

1414
// Stuff we will ignore.
@@ -18,9 +18,6 @@
1818
'./tests/',
1919
'./vendor/',
2020
'./.git',
21-
'./Sources/minify/',
22-
'./Sources/ReCaptcha/',
23-
'./ZxcvbnPhp/',
2421

2522
// We will ignore Settings.php if this is a live dev site.
2623
'./Settings.php',
@@ -64,4 +61,4 @@
6461
} catch (Exception $e) {
6562
fwrite(STDERR, $e->getMessage() . "\n");
6663
exit(1);
67-
}
64+
}

check-smf-license.php

Lines changed: 8 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -5,52 +5,28 @@
55
*
66
* @package SMF
77
* @author Simple Machines https://www.simplemachines.org
8-
* @copyright 2024 Simple Machines and individual contributors
8+
* @copyright 2025 Simple Machines and individual contributors
99
* @license https://www.simplemachines.org/about/smf/license.php BSD
1010
*
11-
* @version 3.0 Alpha 1
11+
* @version 3.0 Alpha 4
1212
*/
1313

1414
// Stuff we will ignore.
1515
$ignoreFiles = [
16-
// Index files.
17-
'\./attachments/index\.php',
18-
'\./avatars/index\.php',
19-
'\./avatars/[A-Za-z0-9]+/index\.php',
20-
'\./cache/index\.php',
21-
'\./custom_avatar/index\.php',
22-
'\./Packages/index\.php',
23-
'\./Packages/backups/index\.php',
24-
'\./Smileys/[A-Za-z0-9]+/index\.php',
25-
'\./Smileys/index\.php',
26-
'\./Sources/index\.php',
27-
'\./Sources/[\w/]+/index\.php',
28-
'\./other/Schema/[\w/]+/*\.php',
29-
'\./Themes/default/index\.php',
30-
'\./Themes/default/[\w/]+/index\.php',
31-
'\./Themes/index\.php',
16+
// Index files in subdirectories.
17+
'\./(?:\w+/)+\bindex\.php',
3218

3319
// Language Files are ignored as they don't use the License format.
34-
'./Themes/default/languages/[A-Za-z0-9]+\.english\.php',
35-
'./Languages/en_US/[A-Za-z0-9]+\.php',
36-
'./Themes/default/languages/en_US/[A-Za-z0-9]+\.php',
37-
'\./Languages/index\.php',
20+
'./Themes/default/languages/',
21+
'\./Languages/',
3822

3923
// Cache and miscellaneous.
4024
'\./cache/',
41-
'\./other/db_last_error\.php',
42-
'\./other/update_[A-Za-z0-9_]+\.php',
4325
'\./tests/',
4426
'\./vendor/',
4527

46-
// Minify Stuff.
47-
'\./Sources/minify/',
48-
49-
// random_compat().
50-
'\./Sources/random_compat/',
51-
52-
// ReCaptcha Stuff.
53-
'\./Sources/ReCaptcha/',
28+
// Everything in other except install.php, upgrade.php, Settings.php and Settings_bak.php.
29+
'\./other/(?!install|upgrade|Settings)\w+\.php',
5430

5531
// We will ignore Settings.php if this is a live dev site.
5632
'\./Settings\.php',

runTools.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
#!/bin/bash
22

33
find . -type f -name "*.php" -print0 \
4-
-o -path "./Sources/minify" -prune \
5-
-o -path "./Sources/random_compat" -prune \
6-
-o -path "./Sources/ReCaptcha" -prune \
74
| xargs -0 -n1 -P4 php -l \
85
| (! grep -v "No syntax errors detected" )
96

107
php check-signed-off.php
118
php check-eof.php
129
php check-smf-license.php
1310
php check-smf-languages.php
14-
php check-version.php
11+
php check-version.php

secure-vendor-dir.php

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?php
2+
3+
/**
4+
* Simple Machines Forum (SMF)
5+
*
6+
* @package SMF
7+
* @author Simple Machines https://www.simplemachines.org
8+
* @copyright 2025 Simple Machines and individual contributors
9+
* @license https://www.simplemachines.org/about/smf/license.php BSD
10+
*
11+
* @version 3.0 Alpha 4
12+
*/
13+
14+
$dirs = ['./vendor'];
15+
16+
$iterator = new RecursiveIteratorIterator(
17+
new RecursiveDirectoryIterator(
18+
'./vendor',
19+
RecursiveDirectoryIterator::SKIP_DOTS | FilesystemIterator::UNIX_PATHS,
20+
),
21+
RecursiveIteratorIterator::SELF_FIRST
22+
);
23+
24+
foreach ($iterator as $item) {
25+
if ($item->isDir()) {
26+
$dirs[] = $item->getPathname();
27+
}
28+
}
29+
30+
foreach ($dirs as $key => $dir) {
31+
if (!file_exists($dir . '/index.php')) {
32+
copy('./Sources/index.php', $dir . '/index.php');
33+
}
34+
}

0 commit comments

Comments
 (0)