diff core/lib/Drupal/Core/Asset/CssOptimizer.php @ 17:129ea1e6d783

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:21:36 +0000
parents 4c8ae668cc8c
children
line wrap: on
line diff
--- a/core/lib/Drupal/Core/Asset/CssOptimizer.php	Tue Jul 10 15:07:59 2018 +0100
+++ b/core/lib/Drupal/Core/Asset/CssOptimizer.php	Thu Feb 28 13:21:36 2019 +0000
@@ -119,7 +119,7 @@
       // If a BOM is found, convert the file to UTF-8, then use substr() to
       // remove the BOM from the result.
       if ($encoding = (Unicode::encodingFromBOM($contents))) {
-        $contents = Unicode::substr(Unicode::convertToUtf8($contents, $encoding), 1);
+        $contents = mb_substr(Unicode::convertToUtf8($contents, $encoding), 1);
       }
       // If no BOM, check for fallback encoding. Per CSS spec the regex is very strict.
       elseif (preg_match('/^@charset "([^"]+)";/', $contents, $matches)) {
@@ -189,7 +189,7 @@
     if ($optimize) {
       // Perform some safe CSS optimizations.
       // Regexp to match comment blocks.
-      $comment     = '/\*[^*]*\*+(?:[^/*][^*]*\*+)*/';
+      $comment = '/\*[^*]*\*+(?:[^/*][^*]*\*+)*/';
       // Regexp to match double quoted strings.
       $double_quot = '"[^"\\\\]*(?:\\\\.[^"\\\\]*)*"';
       // Regexp to match single quoted strings.