Check if config/template file is actually readable before further processing

This commit is contained in:
Lenar Lõhmus 2011-03-03 13:17:34 +02:00 committed by Fabien Potencier
parent a137d72351
commit c6bbecf0bb
2 changed files with 2 additions and 2 deletions

View File

@ -60,7 +60,7 @@ class FilesystemLoader extends Loader
$logs = array();
foreach ($this->templatePathPatterns as $templatePathPattern) {
if (is_file($file = strtr($templatePathPattern, $replacements))) {
if (is_file($file = strtr($templatePathPattern, $replacements)) && is_readable($file)) {
if (null !== $this->debugger) {
$this->debugger->log(sprintf('Loaded template file "%s"', $file));
}

View File

@ -69,7 +69,7 @@ class Yaml
$file = '';
// if input is a file, process it
if (strpos($input, "\n") === false && is_file($input)) {
if (strpos($input, "\n") === false && is_file($input) && is_readable($input)) {
$file = $input;
ob_start();