// Fix write permissions verification on class_index #PSFV-598

This commit is contained in:
rMalie
2012-03-06 14:02:48 +00:00
parent 6f750865ef
commit 5b91fcac4e
+3 -3
View File
@@ -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;
}