Always specify UTF-8 targt charset for html_entity_decode(); default is 8-bit ISO-8859-1 which causes things to break when we later pass them through things that expect to work with UTF-8. For instance, running through preg_replace() with the /u option results in NULL, leading to problems with OStatus and SubMirror generating their plaintext versions and doing length-cropping.

This commit is contained in:
Brion Vibber
2010-09-30 11:29:31 -07:00
parent 91f25ca817
commit 1acc7d66c6
6 changed files with 7 additions and 7 deletions

View File

@@ -208,7 +208,7 @@ END_HELP;
$breakout = preg_replace('/<a[^>+]\bhref="(.*)"[^>]*>(.*)<\/a>/',
'\2 &lt;\1&gt;',
$html);
return html_entity_decode(strip_tags($breakout));
return html_entity_decode(strip_tags($breakout), ENT_QUOTES, 'UTF-8');
}
}