@@ -120,20 +120,26 @@ error occurred:
120120 As the parser is re-entrant, you can use the same parser object to load
121121 different YAML strings.
122122
123- When loading a YAML file, it is sometimes better to use the
123+ It may also be convenient to use the
124124:method: `Symfony\\ Component\\ Yaml\\ Yaml::parse ` wrapper method:
125125
126126..code-block ::php
127127
128128 use Symfony\Component\Yaml\Yaml;
129129
130- $yaml = Yaml::parse('/path/to/file.yml');
130+ $yaml = Yaml::parse(file_get_contents( '/path/to/file.yml') );
131131
132132 The:method: `Symfony\\ Component\\ Yaml\\ Yaml::parse ` static method takes a YAML
133133string or a file containing YAML. Internally, it calls the
134134:method: `Symfony\\ Component\\ Yaml\\ Parser::parse ` method, but enhances the
135135error if something goes wrong by adding the filename to the message.
136136
137+ ..caution ::
138+
139+ Because it is currently possible to pass a filename to this method, you
140+ must validate the input first. Passing a filename is deprecated in
141+ Symfony 2.2, and will be removed in Symfony 3.0.
142+
137143Executing PHP Inside YAML Files
138144~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
139145