From 8a0839f4398b057a20de499dba5afe683a8636fa Mon Sep 17 00:00:00 2001 From: DL6ER Date: Sun, 19 Feb 2017 19:05:06 +0100 Subject: [PATCH] Small security update to the indicidual API files --- api_FTL.php | 6 ++++++ api_PHP.php | 7 ++++++- scripts/pi-hole/js/index.js | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/api_FTL.php b/api_FTL.php index 045c3978..6711d545 100644 --- a/api_FTL.php +++ b/api_FTL.php @@ -6,6 +6,12 @@ * This file is copyright under the latest version of the EUPL. * Please see LICENSE file for your rights under this license */ + +if(!isset($api)) +{ + die("Direct call to api_FTL.php is not allowed!"); +} + require "scripts/pi-hole/php/password.php"; require "scripts/pi-hole/php/auth.php"; diff --git a/api_PHP.php b/api_PHP.php index eea77080..f8f65876 100644 --- a/api_PHP.php +++ b/api_PHP.php @@ -6,7 +6,12 @@ * This file is copyright under the latest version of the EUPL. * Please see LICENSE file for your rights under this license. */ - $api = true; + + if(!isset($api)) + { + die("Direct call to api_PHP.php is not allowed!"); + } + require "scripts/pi-hole/php/password.php"; require "scripts/pi-hole/php/auth.php"; diff --git a/scripts/pi-hole/js/index.js b/scripts/pi-hole/js/index.js index 002fec42..e9226731 100644 --- a/scripts/pi-hole/js/index.js +++ b/scripts/pi-hole/js/index.js @@ -104,7 +104,7 @@ function updateQueryTypes() { var colors = []; // Get colors from AdminLTE $.each($.AdminLTE.options.colors, function(key, value) { colors.push(value); }); - var v = [], c = [], k = []; + var v = [], c = [], k = [], iter; // Collect values and colors, and labels if(data.hasOwnProperty("querytypes")) {