소스 검색

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

Lenar Lõhmus 14 년 전
부모
커밋
c6bbecf0bb
2개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 1
      src/Symfony/Component/Templating/Loader/FilesystemLoader.php
  2. 1 1
      src/Symfony/Component/Yaml/Yaml.php

+ 1 - 1
src/Symfony/Component/Templating/Loader/FilesystemLoader.php

@@ -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));
                 }

+ 1 - 1
src/Symfony/Component/Yaml/Yaml.php

@@ -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();