Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / filter / src / Plugin / Filter / FilterCaption.php
index 62c83950369b82b037a488ce710baba3cde45206..a03c95f5c8ca64f2a5635beb71525f6253b73d22 100644 (file)
@@ -3,7 +3,6 @@
 namespace Drupal\filter\Plugin\Filter;
 
 use Drupal\Component\Utility\Html;
-use Drupal\Component\Utility\Unicode;
 use Drupal\Component\Utility\Xss;
 use Drupal\filter\FilterProcessResult;
 use Drupal\filter\Plugin\FilterBase;
@@ -43,7 +42,7 @@ class FilterCaption extends FilterBase {
         $caption = FilteredMarkup::create(Xss::filter($caption, ['a', 'em', 'strong', 'cite', 'code', 'br']));
 
         // The caption must be non-empty.
-        if (Unicode::strlen($caption) === 0) {
+        if (mb_strlen($caption) === 0) {
           continue;
         }
 
@@ -64,7 +63,7 @@ class FilterCaption extends FilterBase {
           '#caption' => $caption,
           '#classes' => $classes,
         ];
-        $altered_html = drupal_render($filter_caption);
+        $altered_html = \Drupal::service('renderer')->render($filter_caption);
 
         // Load the altered HTML into a new DOMDocument and retrieve the element.
         $updated_nodes = Html::load($altered_html)->getElementsByTagName('body')