From 961ac2c89cc59500fe4bf48d148167d2723a962b Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Mon, 19 Sep 2016 10:28:32 +0100 Subject: [PATCH] Add error detection to peppermint.json loader --- settings.fragment.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/settings.fragment.php b/settings.fragment.php index 27c45fb..6107ec4 100644 --- a/settings.fragment.php +++ b/settings.fragment.php @@ -33,6 +33,12 @@ if(!file_exists("peppermint.json")) else $settings = json_decode(file_get_contents("peppermint.json")); +if($settings === null) +{ + header("content-type: text/plain"); + exit("Error: Failed to decode the settings file! Does it contain a syntax error?"); +} + if($settings->css === "auto") { $settings->css = <<