Use require_once instead of include_once in all cases.

This commit is contained in:
ruan 2020-08-08 13:00:39 +02:00
parent ca86925bb3
commit dc4a25c8cf
4 changed files with 4 additions and 4 deletions

View File

@ -621,7 +621,7 @@ class Page {
$time = microtime(true) - $this->time;
echo "<!-- Page generated in $time seconds. -->";
include_once './inc/footer.php';
require_once './inc/footer.php';
}
function append_param($url, $param) {

View File

@ -9,7 +9,7 @@ final class LangTest extends TestCase {
$dir = './lang';
$langs = glob("$dir/*.php");
foreach ($langs as $lang) {
include_once $lang;
require_once $lang;
$lang_class = $lang;
$lang_class = substr($lang_class, strlen("$dir/")); // grab "en_US.utf8.php" from "./lang/en_US.utf8.php"
$lang_class = substr($lang_class, 0, strpos($lang_class, ".")); // grab "en_US" from "en_US.utf8.php"

View File

@ -2,7 +2,7 @@
use PHPUnit\Framework\TestCase;
include_once './inc/page.php';
require_once './inc/page.php';
final class PageTest extends TestCase {
public function testBansPagerHTML(): void {

View File

@ -8,7 +8,7 @@ if ($page->settings->simple_urls && count($_GET) !== 0) {
if ($target !== "index" && strlen($target) <= 16 && preg_match("/^[a-z]+$/", $target)) {
$local_script = "./${target}.php";
if (file_exists($local_script)) {
include_once $local_script;
require_once $local_script;
return;
}
}