comparison core/lib/Drupal/Component/Serialization/YamlSymfony.php @ 14:1fec387a4317

Update Drupal core to 8.5.2 via Composer
author Chris Cannam
date Mon, 23 Apr 2018 09:46:53 +0100
parents 4c8ae668cc8c
children 129ea1e6d783
comparison
equal deleted inserted replaced
13:5fb285c0d0e3 14:1fec387a4317
32 public static function decode($raw) { 32 public static function decode($raw) {
33 try { 33 try {
34 $yaml = new Parser(); 34 $yaml = new Parser();
35 // Make sure we have a single trailing newline. A very simple config like 35 // Make sure we have a single trailing newline. A very simple config like
36 // 'foo: bar' with no newline will fail to parse otherwise. 36 // 'foo: bar' with no newline will fail to parse otherwise.
37 return $yaml->parse($raw, SymfonyYaml::PARSE_EXCEPTION_ON_INVALID_TYPE); 37 return $yaml->parse($raw, SymfonyYaml::PARSE_EXCEPTION_ON_INVALID_TYPE | SymfonyYaml::PARSE_KEYS_AS_STRINGS);
38 } 38 }
39 catch (\Exception $e) { 39 catch (\Exception $e) {
40 throw new InvalidDataTypeException($e->getMessage(), $e->getCode(), $e); 40 throw new InvalidDataTypeException($e->getMessage(), $e->getCode(), $e);
41 } 41 }
42 } 42 }