mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-13 02:46:29 +00:00
replace file_exists() by is_file() as this is semantically more correct (we don't want dirs to match)
This commit is contained in:
@@ -39,7 +39,7 @@ class Twig_Autoloader
|
||||
return;
|
||||
}
|
||||
|
||||
if (file_exists($file = dirname(__FILE__).'/../'.str_replace(array('_', "\0"), array('/', ''), $class).'.php')) {
|
||||
if (is_file($file = dirname(__FILE__).'/../'.str_replace(array('_', "\0"), array('/', ''), $class).'.php')) {
|
||||
require $file;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -301,7 +301,7 @@ class Twig_Environment
|
||||
if (false === $cache = $this->getCacheFilename($name)) {
|
||||
eval('?>'.$this->compileSource($this->loader->getSource($name), $name));
|
||||
} else {
|
||||
if (!file_exists($cache) || ($this->isAutoReload() && !$this->loader->isFresh($name, filemtime($cache)))) {
|
||||
if (!is_file($cache) || ($this->isAutoReload() && !$this->loader->isFresh($name, filemtime($cache)))) {
|
||||
$this->writeCacheFile($cache, $this->compileSource($this->loader->getSource($name), $name));
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -161,7 +161,7 @@ class Twig_Error extends Exception
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!file_exists($r->getFilename())) {
|
||||
if (!is_file($r->getFilename())) {
|
||||
// probably an eval()'d code
|
||||
return array($currentLine, $currentFile);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user