Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[Yaml][Parser] throw an exception if not readable

  • Loading branch information...
commit efce640a5ef93b147e5f7a984d4454772a2eca80 1 parent 02a12b2
@makasim makasim authored
Showing with 8 additions and 1 deletion.
  1. +8 −1 src/Symfony/Component/Yaml/Yaml.php
View
9 src/Symfony/Component/Yaml/Yaml.php
@@ -47,7 +47,14 @@ static public function parse($input)
$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 \InvalidArgumentException(sprintf(
+ 'The service file "%s" is not readable.',
+ $input
+ ));
+ }
+
$file = $input;
ob_start();
Please sign in to comment.
Something went wrong with that request. Please try again.