diff --git a/core/lib/Drupal/Core/Template/AttributeString.php b/core/lib/Drupal/Core/Template/AttributeString.php index 9776467..e71aa57 100644 --- a/core/lib/Drupal/Core/Template/AttributeString.php +++ b/core/lib/Drupal/Core/Template/AttributeString.php @@ -29,7 +29,17 @@ class AttributeString extends AttributeValueBase { */ public function __toString() { $this->printed = TRUE; - return check_plain($this->value); + $bag = ''; + preg_match_all("/[^&]+|&[^&]+.;+|&/",($this->value), $out); + foreach ($out[0] as $part ) { + if ((substr(($part),0,1) == '&') && (substr(($part),-1,1) == ';')) { + $bag .= '&' . check_plain(substr($part,1)) ; + } + else { + $bag .= check_plain($part); + } + } + return $bag; } }