diff --git a/core/modules/color/color.module b/core/modules/color/color.module index 3cae04532e..5f19b1328c 100644 --- a/core/modules/color/color.module +++ b/core/modules/color/color.module @@ -15,6 +15,7 @@ use Drupal\Core\Language\LanguageInterface; use Drupal\Core\Render\Element\Textfield; use Drupal\Core\Routing\RouteMatchInterface; +use Drupal\Component\Utility\Xss; /** * Implements hook_help(). @@ -300,8 +301,8 @@ function template_preprocess_color_scheme_form(&$variables) { } // Attempt to load preview HTML if the theme provides it. - $preview_html_path = \Drupal::root() . '/' . (isset($info['preview_html']) ? drupal_get_path('theme', $theme) . '/' . $info['preview_html'] : drupal_get_path('module', 'color') . '/preview.html'); - $variables['html_preview']['#markup'] = file_get_contents($preview_html_path); + $preview_html_path = isset($info['preview_html']) ? drupal_get_path('theme', $theme) . '/' . $info['preview_html'] : drupal_get_path('module', 'color') . '/preview.html.twig'; + $variables['html_preview']['#markup'] = \Drupal::service('twig')->loadTemplate($preview_html_path, NULL)->render(array()); } /** diff --git a/core/modules/color/preview.html b/core/modules/color/preview.html deleted file mode 100644 index d89edcb0d0..0000000000 --- a/core/modules/color/preview.html +++ /dev/null @@ -1,7 +0,0 @@ -
Sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
-+ {% trans %} This is a block of example content. This content is here to demonstrate what actual content would look like in the color scheme you configure. This is an example link, is is here to demonstrate how background colors you configure may affect the readability of links. This content is here to demonstrate what actual content would look like in the color scheme you configure. {% endtrans %} +
+