From 5b91fcac4ebeedb440686ffe58f9c65827497935 Mon Sep 17 00:00:00 2001 From: rMalie Date: Tue, 6 Mar 2012 14:02:48 +0000 Subject: [PATCH] // Fix write permissions verification on class_index #PSFV-598 --- classes/Autoload.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/classes/Autoload.php b/classes/Autoload.php index ad4f3c49f..96bb8f54d 100644 --- a/classes/Autoload.php +++ b/classes/Autoload.php @@ -133,7 +133,9 @@ class Autoload // Write classes index on disc to cache it $filename = $this->root_dir.Autoload::INDEX_FILE; - if ((file_exists($filename) && is_writable($filename)) || is_writable(dirname($filename))) + if ((file_exists($filename) && !is_writable($filename)) || !is_writable(dirname($filename))) + throw new PrestaShopException($filename.' is not writable, please give write permissions (chmod 666) on this file.'); + else { // Let's write index content in cache file // In order to be sure that this file is correctly written, a check is done on the file content @@ -157,8 +159,6 @@ class Autoload throw new PrestaShopException('Your file '.$filename.' is corrupted. Please remove this file, a new one will be regenerated automatically'); } } - else - throw new PrestaShopException($filename.' is not writable!'); $this->index = $classes; }