mirror of
https://github.com/getformwork/formwork.git
synced 2025-02-24 17:52:41 +01:00
Optimize YAML::parse()
This commit is contained in:
parent
fb147fd094
commit
09092a3bd3
@ -25,7 +25,7 @@ class YAML extends AbstractParser
|
||||
public static function parse($input, array $options = [])
|
||||
{
|
||||
if (function_exists('yaml_parse') && ($options['usePHPYAML'] ?? static::PHPYAMLmode('parse'))) {
|
||||
if (!preg_match('/^---\n/', $input)) {
|
||||
if (strpos($input, "---\n") !== 0) {
|
||||
$input = "---\n" . $input;
|
||||
}
|
||||
return (array) yaml_parse($input);
|
||||
|
Loading…
x
Reference in New Issue
Block a user