From f819eaf65cea6191c6756cf84d694d9f7b18a33a Mon Sep 17 00:00:00 2001 From: Matthew Vale Date: Thu, 26 Nov 2015 11:23:52 +0000 Subject: [PATCH] Added check will now throw if the config.lua could not be opened for writing --- core/databases/app_defaults.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/databases/app_defaults.php b/core/databases/app_defaults.php index ea4d04d6c9..71adfaced2 100644 --- a/core/databases/app_defaults.php +++ b/core/databases/app_defaults.php @@ -126,6 +126,9 @@ if ($domains_processed == 1) { $config = $_SESSION['switch']['scripts']['dir']."/resources/config.lua"; } $fout = fopen($config,"w"); + if(!$fout){ + throw new Exception("Failed to open '$config' for writing"); + } $tmp = "\n"; $tmp .= "--set the variables\n"; if (strlen($_SESSION['switch']['sounds']['dir']) > 0) {