Skip to content

Commit

Permalink
Merge pull request #7887 from jdarwood007/indexCleanup
Browse files Browse the repository at this point in the history
Index cleanup
  • Loading branch information
Sesquipedalian authored Nov 16, 2023
2 parents a6dd30b + e511f5b commit 03d0fab
Show file tree
Hide file tree
Showing 61 changed files with 189 additions and 193 deletions.
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

0 comments on commit 03d0fab

Please sign in to comment.