From 194dccfd936f1ba35e362230f26e8bab4605d024 Mon Sep 17 00:00:00 2001 From: markjcrane Date: Sun, 3 Apr 2016 09:36:27 -0600 Subject: [PATCH] Use is_dir instead of check for the length of the stirng. --- app/scripts/app_defaults.php | 8 +++----- app/scripts/resources/classes/scripts.php | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/app/scripts/app_defaults.php b/app/scripts/app_defaults.php index 31b4452610..2cb75df991 100644 --- a/app/scripts/app_defaults.php +++ b/app/scripts/app_defaults.php @@ -26,11 +26,9 @@ //process this only one time if ($domains_processed == 1) { - if (isset($_SESSION['switch']['scripts']['dir'])) { - $obj = new scripts; - $obj->copy_files(); - $obj->write_config(); - } + $obj = new scripts; + $obj->copy_files(); + $obj->write_config(); } ?> \ No newline at end of file diff --git a/app/scripts/resources/classes/scripts.php b/app/scripts/resources/classes/scripts.php index f9df3b19ac..ecf29e3da8 100644 --- a/app/scripts/resources/classes/scripts.php +++ b/app/scripts/resources/classes/scripts.php @@ -99,7 +99,7 @@ class scripts { * Writes the config.lua */ public function write_config() { - if (strlen($_SESSION['switch']['scripts']['dir']) > 0) { + if (is_dir($_SESSION['switch']['scripts']['dir'])) { //define the global variables global $db;