// Fix write permissions verification on class_index #PSFV-598
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user