diff --git a/src/Symfony/Component/Yaml/Yaml.php b/src/Symfony/Component/Yaml/Yaml.php index aad88fdc19..a59ce86f48 100644 --- a/src/Symfony/Component/Yaml/Yaml.php +++ b/src/Symfony/Component/Yaml/Yaml.php @@ -47,7 +47,11 @@ class Yaml $file = ''; // if input is a file, process it - if (strpos($input, "\n") === false && is_file($input) && is_readable($input)) { + if (strpos($input, "\n") === false && is_file($input)) { + if (false === is_readable($input)) { + throw new ParseException(sprintf('Unable to parse "%s" as the file is not readable.', $input)); + } + $file = $input; ob_start();