Commit 0430fa63 authored by 20th's avatar 20th Committed by helmo

Issue #2850197 by 20th: 'Verify' task fails when module *.info file contains non-UTF-8 symbols

parent baaa6916
......@@ -74,6 +74,11 @@ function _provision_drupal_parse_info_file($filename) {
}
$value = stripslashes(substr($value1, 1, -1)) . stripslashes(substr($value2, 1, -1)) . $value3;
// Remove any invalid UTF-8 sequences to prevent serialization errors.
if (function_exists('mb_convert_encoding')) {
$value = mb_convert_encoding($value, 'UTF-8', 'UTF-8');
}
// Parse array syntax
$keys = preg_split('/\]?\[/', rtrim($key, ']'));
$last = array_pop($keys);
......
......@@ -82,6 +82,11 @@ function _provision_drupal_parse_info_file($filename) {
}
$value = stripslashes(substr($value1, 1, -1)) . stripslashes(substr($value2, 1, -1)) . $value3;
// Remove any invalid UTF-8 sequences to prevent serialization errors.
if (function_exists('mb_convert_encoding')) {
$value = mb_convert_encoding($value, 'UTF-8', 'UTF-8');
}
// Parse array syntax
$keys = preg_split('/\]?\[/', rtrim($key, ']'));
$last = array_pop($keys);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment