8000 merged branch makasim/yaml-throw-not-readable (PR #3105) · lsmith77/symfony@119a24f · GitHub
[go: up one dir, main page]

Skip to content

Commit 119a24f

Browse files
committed
merged branch makasim/yaml-throw-not-readable (PR symfony#3105)
Commits ------- 7961014 [Yaml][Parser] changes according review efce640 [Yaml][Parser] throw an exception if not readable Discussion ---------- [Yaml][Parser] throw an exception if service file not readable. Bug fix: no Feature addition: yes Backwards compatibility break: no Symfony2 tests pass: yes Fixes the following tickets: symfony#3077 Todo: - --------------------------------------------------------------------------- by makasim at 2012-01-13T15:49:49Z @fabpot done
2 parents 64bd058 + 7961014 commit 119a24f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Symfony/Component/Yaml/Yaml.php

Lines changed: 5 additions & 1 deletion
6A2C
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,11 @@ static public function parse($input)
4747
$file = '';
4848

4949
// if input is a file, process it
50-
if (strpos($input, "\n") === false && is_file($input) && is_readable($input)) {
50+
if (strpos($input, "\n") === false && is_file($input)) {
51+
if (false === is_readable($input)) {
52+
throw new ParseException(sprintf('Unable to parse "%s" as the file is not readable.', $input));
53+
}
54+
5155
$file = $input;
5256

5357
ob_start();

0 commit comments

Comments
 (0)
0