diff --git a/core/lib/Drupal/Component/Serialization/Yaml.php b/core/lib/Drupal/Component/Serialization/Yaml.php index fcc4baf..98d209a 100644 --- a/core/lib/Drupal/Component/Serialization/Yaml.php +++ b/core/lib/Drupal/Component/Serialization/Yaml.php @@ -17,7 +17,7 @@ class Yaml implements SerializationInterface { * * @var \Drupal\Component\Serialization\SerializationInterface */ - protected static $instance; + protected static $serializer; /** * Determines the optimal implementation to use for encoding and parsing Yaml. @@ -26,16 +26,16 @@ class Yaml implements SerializationInterface { * performant available option chosen. */ public function __construct() { - if (isset(static::$instance)) { + if (isset(static::$serializer)) { return; } // If the PECL YAML extension installed, use that. if (extension_loaded('yaml')) { - static::$instance = new YamlPecl(); + static::$serializer = new YamlPecl(); } else { // Otherwise, fallback to the Symfony implementation. - static::$instance = new YamlSymfony(); + static::$serializer = new YamlSymfony(); } } @@ -43,20 +43,20 @@ public function __construct() { * {@inheritdoc} */ public static function encode($data) { - if (!isset(static::$instance)) { + if (!isset(static::$serializer)) { new static(); } - return static::$instance->encode($data); + return static::$serializer->encode($data); } /** * {@inheritdoc} */ public static function decode($raw) { - if (!isset(static::$instance)) { + if (!isset(static::$serializer)) { new static(); } - return static::$instance->decode($raw); + return static::$serializer->decode($raw); } /** diff --git a/core/lib/Drupal/Component/Serialization/YamlPecl.php b/core/lib/Drupal/Component/Serialization/YamlPecl.php index 7d5b586..03a8a31 100644 --- a/core/lib/Drupal/Component/Serialization/YamlPecl.php +++ b/core/lib/Drupal/Component/Serialization/YamlPecl.php @@ -40,7 +40,6 @@ public static function decode($raw) { $ndocs = 0; $data = yaml_parse($raw, 0, $ndocs, [ YAML_BOOL_TAG => '\Drupal\Component\Serialization\YamlPecl::applyBooleanCallbacks', - YAML_SEQ_TAG => '\Drupal\Component\Serialization\YamlPecl::applySequenceCallbacks' ]); restore_error_handler(); return $data; @@ -89,25 +88,4 @@ public static function applyBooleanCallbacks($value, $tag, $flags) { return $map[strtolower($value)]; } - /** - * Applies sequence after parsing to ignore 1.1 issues. - * - * @param mixed $value - * Value from YAML file. - * @param string $tag - * Tag that triggered the callback. - * @param int $flags - * Scalar entity style flags. - * - * @return array|string - * Yaml 1.1 decodes - - as an array containg a NULL, in 1.2 it should be the - * string '-'. - */ - public static function applySequenceCallbacks($value, $tag, $flags) { - if ($value == [NULL]) { - return '-'; - } - return $value; - } - } diff --git a/core/lib/Drupal/Core/Serialization/Yaml.php b/core/lib/Drupal/Core/Serialization/Yaml.php index ff663d8..37a47b9 100644 --- a/core/lib/Drupal/Core/Serialization/Yaml.php +++ b/core/lib/Drupal/Core/Serialization/Yaml.php @@ -27,21 +27,21 @@ class Yaml extends ComponentYaml { * performant available option chosen. */ public function __construct() { - if (isset(static::$instance)) { + if (isset(static::$serializer)) { return; } $settings = Settings::getInstance(); // If there is a settings.php override, use that. if ($settings && ($class = $settings->get('yaml_parser_class'))) { - static::$instance = new $class(); + static::$serializer = new $class(); } // If the PECL YAML extension installed, use that. elseif (extension_loaded('yaml')) { - static::$instance = new YamlPecl(); + static::$serializer = new YamlPecl(); } else { // Otherwise, fallback to the Symfony implementation. - static::$instance = new YamlSymfony(); + static::$serializer = new YamlSymfony(); } } diff --git a/core/profiles/standard/config/install/editor.editor.full_html.yml b/core/profiles/standard/config/install/editor.editor.full_html.yml index 80da28c..34800d1 100644 --- a/core/profiles/standard/config/install/editor.editor.full_html.yml +++ b/core/profiles/standard/config/install/editor.editor.full_html.yml @@ -12,7 +12,7 @@ settings: - Strike - Superscript - Subscript - - - + - '-' - RemoveFormat - name: Linking