From 349087a478704257ec86561dc774c358ab760c64 Mon Sep 17 00:00:00 2001 From: Austin Gillmann Date: Sun, 22 May 2016 20:03:38 -0500 Subject: Replace include_once statements with require_once Normally in include_once if a script does not load PHP will treat it as such as an E_WARNING, while require_once fail the script with a E_COMPILE_ERROR if the script does not load. Since we require all of these scripts to properly function it will be better to classify them as required in PHP. Reported-by: Juuso Lapinlampi Reviewed-by: Juuso Lapinlampi --- static/includes/database.inc.php | 2 +- static/upload.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'static') diff --git a/static/includes/database.inc.php b/static/includes/database.inc.php index 0374afa..ff04561 100644 --- a/static/includes/database.inc.php +++ b/static/includes/database.inc.php @@ -22,7 +22,7 @@ * SOFTWARE. */ -include_once 'settings.inc.php'; +require_once 'settings.inc.php'; /* NOTE: we don't have to unref the PDO because we're not long-running */ $db = new PDO(POMF_DB_CONN, POMF_DB_USER, POMF_DB_PASS); diff --git a/static/upload.php b/static/upload.php index c296d24..4bee979 100644 --- a/static/upload.php +++ b/static/upload.php @@ -32,10 +32,10 @@ if (ini_get('zlib.output_compression') !== 'Off' ob_start('ob_gzhandler'); } -include_once 'classes/Response.class.php'; -include_once 'classes/UploadException.class.php'; -include_once 'classes/UploadedFile.class.php'; -include_once 'includes/database.inc.php'; +require_once 'classes/Response.class.php'; +require_once 'classes/UploadException.class.php'; +require_once 'classes/UploadedFile.class.php'; +require_once 'includes/database.inc.php'; /** * Generates a random name for the file, retrying until we get an unused one. -- cgit v1.2.3