[*] Core: don't re-generate the class_index.php file if a class is not known to avoid misuse of class_exists()

This commit is contained in:
Rémi Gaillard committed 2013-09-12 15:03:23 +02:00
1 parent cc36eb2d27
commit f9b1f0ab5e
3 files changed
+3 -3

No files matched your search

@@ -41,7 +41,7 @@
{/if} {/if}
{$smarty.block.parent} {$smarty.block.parent}
{if $input.type == 'radio' && $input.name == 'smarty_cache'} {if $input.type == 'radio' && $input.name == 'smarty_cache'}
<a href="{$current}&token={$token}&empty_smarty_cache=1" class="clear button" href="">{l s='Clear Smarty cache'}</a> <a href="{$current}&token={$token}&empty_smarty_cache=1" class="clear button" href="">{l s='Clear Smarty cache & Autoload cache'}</a>
{/if} {/if}
{/block} {/block}
+1 -2
View File
@@ -81,8 +81,7 @@ class Autoload
return; return;
// regenerate the class index if the requested class is not found in the index or if the requested file doesn't exists // regenerate the class index if the requested class is not found in the index or if the requested file doesn't exists
if (!isset($this->index[$classname]) if ((isset($this->index[$classname]) && $this->index[$classname] && !is_file($this->root_dir.$this->index[$classname]))
|| ($this->index[$classname] && !is_file($this->root_dir.$this->index[$classname]))
|| (isset($this->index[$classname.'Core']) && $this->index[$classname.'Core'] && !is_file($this->root_dir.$this->index[$classname.'Core']))) || (isset($this->index[$classname.'Core']) && $this->index[$classname.'Core'] && !is_file($this->root_dir.$this->index[$classname.'Core'])))
$this->generateIndex(); $this->generateIndex();
@@ -796,6 +796,7 @@ class AdminPerformanceControllerCore extends AdminController
{ {
$redirectAdmin = true; $redirectAdmin = true;
Tools::clearSmartyCache(); Tools::clearSmartyCache();
Autoload::getInstance()->generateIndex();
} }
if ($redirectAdmin && (!isset($this->errors) || !count($this->errors))) if ($redirectAdmin && (!isset($this->errors) || !count($this->errors)))