Commit 7f3d4cfb authored by gisle's avatar gisle
Browse files

Issue #2659746 by gisle: Do not choke on invalid multibyte sequences

parent 9451186f
......@@ -640,7 +640,11 @@ function advanced_help_view_topic($module, $topic, $popup = FALSE) {
$info = advanced_help_get_topic($module, $topic);
$file = "./$file_info[path]/$file_info[file]";
// Fix invalid byte sequences (Issue #1330056).
$output = file_get_contents($file);
mb_substitute_character(0xfffd);
$output = mb_convert_encoding($output, 'UTF-8', 'UTF-8');
if (isset($info['readme file']) && $info['readme file']) {
$ext = pathinfo($file, PATHINFO_EXTENSION);
if ('md' == $ext && module_exists('markdown')) {
......
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