diff --git a/core/lib/Drupal/Core/Template/AttributeString.php b/core/lib/Drupal/Core/Template/AttributeString.php index 9776467..76e0564 100644 --- a/core/lib/Drupal/Core/Template/AttributeString.php +++ b/core/lib/Drupal/Core/Template/AttributeString.php @@ -29,7 +29,15 @@ 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) == ';')) && (strlen($part) > 2)) { + $bag .= '&' . check_plain(substr($part,1)) ; } + else { + $bag .= check_plain($part); + } + } + return $bag; } - }