Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Index cleanup #7887

Merged
merged 2 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
php ./vendor/simplemachines/build-tools/check-eof.php
php ./vendor/simplemachines/build-tools/check-smf-license.php
php ./vendor/simplemachines/build-tools/check-smf-languages.php
php ./vendor/simplemachines/build-tools/check-smf-index.php
php ./vendor/simplemachines/build-tools/check-version.php

lint:
Expand Down
4 changes: 2 additions & 2 deletions Packages/backups/index.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

// Try to handle it with the upper level index.php. (it should know what to do.)
if (file_exists(dirname(dirname(__FILE__)) . '/index.php'))
include (dirname(dirname(__FILE__)) . '/index.php');
if (file_exists(dirname(__DIR__) . '/index.php'))
include (dirname(__DIR__) . '/index.php');
else
exit;

Expand Down
15 changes: 3 additions & 12 deletions Packages/index.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
<?php

/**
* This file is here solely to protect your Packages directory.
*/

// Look for Settings.php....
if (file_exists(dirname(dirname(__FILE__)) . '/Settings.php'))
{
// Found it!
require(dirname(dirname(__FILE__)) . '/Settings.php');
header('location: ' . $boardurl);
}
// Can't find it... just forget it.
// Try to handle it with the upper level index.php. (it should know what to do.)
if (file_exists(dirname(__DIR__) . '/index.php'))
include (dirname(__DIR__) . '/index.php');
else
exit;

Expand Down
4 changes: 2 additions & 2 deletions Smileys/alienine/index.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

// Try to handle it with the upper level index.php. (it should know what to do.)
if (file_exists(dirname(dirname(__FILE__)) . '/index.php'))
include (dirname(dirname(__FILE__)) . '/index.php');
if (file_exists(dirname(__DIR__) . '/index.php'))
include (dirname(__DIR__) . '/index.php');
else
exit;

Expand Down
4 changes: 2 additions & 2 deletions Smileys/fugue/index.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

// Try to handle it with the upper level index.php. (it should know what to do.)
if (file_exists(dirname(dirname(__FILE__)) . '/index.php'))
include (dirname(dirname(__FILE__)) . '/index.php');
if (file_exists(dirname(__DIR__) . '/index.php'))
include (dirname(__DIR__) . '/index.php');
else
exit;

Expand Down
15 changes: 3 additions & 12 deletions Smileys/index.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
<?php

/**
* This file is here solely to protect your Smileys directory.
*/

// Look for Settings.php....
if (file_exists(dirname(dirname(__FILE__)) . '/Settings.php'))
{
// Found it!
require(dirname(dirname(__FILE__)) . '/Settings.php');
header('location: ' . $boardurl);
}
// Can't find it... just forget it.
// Try to handle it with the upper level index.php. (it should know what to do.)
if (file_exists(dirname(__DIR__) . '/index.php'))
include (dirname(__DIR__) . '/index.php');
else
exit;

Expand Down
9 changes: 9 additions & 0 deletions Sources/Actions/Admin/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

// Try to handle it with the upper level index.php. (it should know what to do.)
if (file_exists(dirname(__DIR__) . '/index.php'))
include (dirname(__DIR__) . '/index.php');
else
exit;

?>
9 changes: 9 additions & 0 deletions Sources/Actions/Moderation/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

// Try to handle it with the upper level index.php. (it should know what to do.)
if (file_exists(dirname(__DIR__) . '/index.php'))
include (dirname(__DIR__) . '/index.php');
else
exit;

?>
9 changes: 9 additions & 0 deletions Sources/Actions/Profile/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

// Try to handle it with the upper level index.php. (it should know what to do.)
if (file_exists(dirname(__DIR__) . '/index.php'))
include (dirname(__DIR__) . '/index.php');
else
exit;

?>
9 changes: 9 additions & 0 deletions Sources/Actions/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

// Try to handle it with the upper level index.php. (it should know what to do.)
if (file_exists(dirname(__DIR__) . '/index.php'))
include (dirname(__DIR__) . '/index.php');
else
exit;

?>
4 changes: 2 additions & 2 deletions Sources/Cache/APIs/index.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

// Try to handle it with the upper level index.php. (it should know what to do.)
if (file_exists(dirname(dirname(__FILE__)) . '/index.php'))
include (dirname(dirname(__FILE__)) . '/index.php');
if (file_exists(dirname(__DIR__) . '/index.php'))
include (dirname(__DIR__) . '/index.php');
else
exit;

Expand Down
4 changes: 2 additions & 2 deletions Sources/Cache/index.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

// Try to handle it with the upper level index.php. (it should know what to do.)
if (file_exists(dirname(dirname(__FILE__)) . '/index.php'))
include (dirname(dirname(__FILE__)) . '/index.php');
if (file_exists(dirname(__DIR__) . '/index.php'))
include (dirname(__DIR__) . '/index.php');
else
exit;

Expand Down
4 changes: 2 additions & 2 deletions Sources/Db/APIs/index.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

// Try to handle it with the upper level index.php. (it should know what to do.)
if (file_exists(dirname(dirname(__FILE__)) . '/index.php'))
include (dirname(dirname(__FILE__)) . '/index.php');
if (file_exists(dirname(__DIR__) . '/index.php'))
include (dirname(__DIR__) . '/index.php');
else
exit;

Expand Down
4 changes: 2 additions & 2 deletions Sources/Db/index.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

// Try to handle it with the upper level index.php. (it should know what to do.)
if (file_exists(dirname(dirname(__FILE__)) . '/index.php'))
include (dirname(dirname(__FILE__)) . '/index.php');
if (file_exists(dirname(__DIR__) . '/index.php'))
include (dirname(__DIR__) . '/index.php');
else
exit;

Expand Down
4 changes: 2 additions & 2 deletions Sources/Graphics/Gif/index.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

// Try to handle it with the upper level index.php. (it should know what to do.)
if (file_exists(dirname(dirname(__FILE__)) . '/index.php'))
include (dirname(dirname(__FILE__)) . '/index.php');
if (file_exists(dirname(__DIR__) . '/index.php'))
include (dirname(__DIR__) . '/index.php');
else
exit;

Expand Down
4 changes: 2 additions & 2 deletions Sources/Graphics/index.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

// Try to handle it with the upper level index.php. (it should know what to do.)
if (file_exists(dirname(dirname(__FILE__)) . '/index.php'))
include (dirname(dirname(__FILE__)) . '/index.php');
if (file_exists(dirname(__DIR__) . '/index.php'))
include (dirname(__DIR__) . '/index.php');
else
exit;

Expand Down
4 changes: 2 additions & 2 deletions Sources/PackageManager/index.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

// Try to handle it with the upper level index.php. (it should know what to do.)
if (file_exists(dirname(dirname(__FILE__)) . '/index.php'))
include (dirname(dirname(__FILE__)) . '/index.php');
if (file_exists(dirname(__DIR__) . '/index.php'))
include (dirname(__DIR__) . '/index.php');
else
exit;

Expand Down
9 changes: 9 additions & 0 deletions Sources/PersonalMessage/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

// Try to handle it with the upper level index.php. (it should know what to do.)
if (file_exists(dirname(__DIR__) . '/index.php'))
include (dirname(__DIR__) . '/index.php');
else
exit;

?>
4 changes: 2 additions & 2 deletions Sources/ReCaptcha/RequestMethod/index.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

// Try to handle it with the upper level index.php. (it should know what to do.)
if (file_exists(dirname(dirname(__FILE__)) . '/index.php'))
include (dirname(dirname(__FILE__)) . '/index.php');
if (file_exists(dirname(__DIR__) . '/index.php'))
include (dirname(__DIR__) . '/index.php');
else
exit;

Expand Down
4 changes: 2 additions & 2 deletions Sources/ReCaptcha/index.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

// Try to handle it with the upper level index.php. (it should know what to do.)
if (file_exists(dirname(dirname(__FILE__)) . '/index.php'))
include (dirname(dirname(__FILE__)) . '/index.php');
if (file_exists(dirname(__DIR__) . '/index.php'))
include (dirname(__DIR__) . '/index.php');
else
exit;

Expand Down
4 changes: 2 additions & 2 deletions Sources/Search/APIs/index.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

// Try to handle it with the upper level index.php. (it should know what to do.)
if (file_exists(dirname(dirname(__FILE__)) . '/index.php'))
include (dirname(dirname(__FILE__)) . '/index.php');
if (file_exists(dirname(__DIR__) . '/index.php'))
include (dirname(__DIR__) . '/index.php');
else
exit;

Expand Down
4 changes: 2 additions & 2 deletions Sources/Search/index.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

// Try to handle it with the upper level index.php. (it should know what to do.)
if (file_exists(dirname(dirname(__FILE__)) . '/index.php'))
include (dirname(dirname(__FILE__)) . '/index.php');
if (file_exists(dirname(__DIR__) . '/index.php'))
include (dirname(__DIR__) . '/index.php');
else
exit;

Expand Down
15 changes: 3 additions & 12 deletions Sources/Security.php
Original file line number Diff line number Diff line change
Expand Up @@ -349,18 +349,9 @@ public static function secureDirectory(string|array $paths, bool $attachments =
$contents = <<<END
<?php

/**
* This file is here solely to protect your $directory_name directory.
*/

// Look for Settings.php....
if (file_exists(dirname(dirname(__FILE__)) . '/Settings.php'))
{
// Found it!
require(dirname(dirname(__FILE__)) . '/Settings.php');
header('location: ' . \$boardurl);
}
// Can't find it... just forget it.
// Try to handle it with the upper level index.php. (it should know what to do.)
if (file_exists(dirname(__DIR__) . '/index.php'))
include (dirname(__DIR__) . '/index.php');
else
exit;

Expand Down
4 changes: 2 additions & 2 deletions Sources/Subscriptions/PayPal/index.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

// Try to handle it with the upper level index.php. (it should know what to do.)
if (file_exists(dirname(dirname(__FILE__)) . '/index.php'))
include (dirname(dirname(__FILE__)) . '/index.php');
if (file_exists(dirname(__DIR__) . '/index.php'))
include (dirname(__DIR__) . '/index.php');
else
exit;

Expand Down
4 changes: 2 additions & 2 deletions Sources/Subscriptions/index.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

// Try to handle it with the upper level index.php. (it should know what to do.)
if (file_exists(dirname(dirname(__FILE__)) . '/index.php'))
include (dirname(dirname(__FILE__)) . '/index.php');
if (file_exists(dirname(__DIR__) . '/index.php'))
include (dirname(__DIR__) . '/index.php');
else
exit;

Expand Down
4 changes: 2 additions & 2 deletions Sources/TOTP/index.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

// Try to handle it with the upper level index.php. (it should know what to do.)
if (file_exists(dirname(dirname(__FILE__)) . '/index.php'))
include (dirname(dirname(__FILE__)) . '/index.php');
if (file_exists(dirname(__DIR__) . '/index.php'))
include (dirname(__DIR__) . '/index.php');
else
exit;

Expand Down
4 changes: 2 additions & 2 deletions Sources/Unicode/index.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

// Try to handle it with the upper level index.php. (it should know what to do.)
if (file_exists(dirname(dirname(__FILE__)) . '/index.php'))
include (dirname(dirname(__FILE__)) . '/index.php');
if (file_exists(dirname(__DIR__) . '/index.php'))
include (dirname(__DIR__) . '/index.php');
else
exit;

Expand Down
4 changes: 2 additions & 2 deletions Sources/WebFetch/APIs/index.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

// Try to handle it with the upper level index.php. (it should know what to do.)
if (file_exists(dirname(dirname(__FILE__)) . '/index.php'))
include (dirname(dirname(__FILE__)) . '/index.php');
if (file_exists(dirname(__DIR__) . '/index.php'))
include (dirname(__DIR__) . '/index.php');
else
exit;

Expand Down
4 changes: 2 additions & 2 deletions Sources/WebFetch/index.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

// Try to handle it with the upper level index.php. (it should know what to do.)
if (file_exists(dirname(dirname(__FILE__)) . '/index.php'))
include (dirname(dirname(__FILE__)) . '/index.php');
if (file_exists(dirname(__DIR__) . '/index.php'))
include (dirname(__DIR__) . '/index.php');
else
exit;

Expand Down
15 changes: 3 additions & 12 deletions Sources/index.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
<?php

/**
* This file is here solely to protect your Sources directory.
*/

// Look for Settings.php....
if (file_exists(dirname(dirname(__FILE__)) . '/Settings.php'))
{
// Found it!
require(dirname(dirname(__FILE__)) . '/Settings.php');
header('location: ' . $boardurl);
}
// Can't find it... just forget it.
// Try to handle it with the upper level index.php. (it should know what to do.)
if (file_exists(dirname(__DIR__) . '/index.php'))
include (dirname(__DIR__) . '/index.php');
else
exit;

Expand Down
4 changes: 2 additions & 2 deletions Sources/minify/data/index.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

// Try to handle it with the upper level index.php. (it should know what to do.)
if (file_exists(dirname(dirname(__FILE__)) . '/index.php'))
include (dirname(dirname(__FILE__)) . '/index.php');
if (file_exists(dirname(__DIR__) . '/index.php'))
include (dirname(__DIR__) . '/index.php');
else
exit;

Expand Down
4 changes: 2 additions & 2 deletions Sources/minify/data/js/index.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

// Try to handle it with the upper level index.php. (it should know what to do.)
if (file_exists(dirname(dirname(__FILE__)) . '/index.php'))
include (dirname(dirname(__FILE__)) . '/index.php');
if (file_exists(dirname(__DIR__) . '/index.php'))
include (dirname(__DIR__) . '/index.php');
else
exit;

Expand Down
Loading
Loading