From ba6d285f40477d7d284e28efdf94039e1fc9ee5f Mon Sep 17 00:00:00 2001 From: Guillaume Mazoyer Date: Thu, 29 May 2014 17:19:26 +0200 Subject: Prevent PHP to be executed when not going through index.php. --- execute.php | 4 ++++ index.php | 2 ++ router.php | 4 ++++ utils.php | 4 ++++ 4 files changed, 14 insertions(+) diff --git a/execute.php b/execute.php index 72f7d0b..49e04df 100644 --- a/execute.php +++ b/execute.php @@ -19,6 +19,10 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +if (!defined('LOOKING_GLASS01')) { + exit; +} + require_once 'config.php'; require_once 'router.php'; require_once 'utils.php'; diff --git a/index.php b/index.php index 895be86..8e43b67 100644 --- a/index.php +++ b/index.php @@ -18,6 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +define('LOOKING_GLASS01', 1); + require_once 'config.php'; ?> diff --git a/router.php b/router.php index f19e6d0..a9f33be 100644 --- a/router.php +++ b/router.php @@ -19,6 +19,10 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +if (!defined('LOOKING_GLASS01')) { + exit; +} + require_once 'config.php'; require_once 'utils.php'; diff --git a/utils.php b/utils.php index 6baafb8..ec3db07 100644 --- a/utils.php +++ b/utils.php @@ -19,6 +19,10 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +if (!defined('LOOKING_GLASS01')) { + exit; +} + function match_ipv4($ip) { return filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4); } -- cgit v1.2.3