fix problem with unmotivated linebreaks in text on wordwrap. issue reported on userlist for broken umlauts

This commit is contained in:
Klaus Leithoff 2013-08-20 11:22:18 +00:00
parent f1d6806fb1
commit 30a3fd1b6b

View File

@ -3220,15 +3220,17 @@
substr($line,0,strlen($dontbreaklinesstartingwith)) != $dontbreaklinesstartingwith
)
)
) {
)
{
$s=explode(" ", $line);
$line = "";
$linecnt = 0;
foreach ($s as $k=>$v) {
$cnt = strlen($v);
// only break long words within the wordboundaries,
// but it may destroy links, so we check for href and dont it if we find one
if($cnt > $allowedLength && stripos($v,'href=')===false && stripos($v,'onclick=')===false)
// but it may destroy links, so we check for href and dont do it if we find one
// we check for any html within the word, because we do not want to break html by accident
if($cnt > $allowedLength && stripos($v,'href=')===false && stripos($v,'onclick=')===false && $cnt == strlen(html_entity_decode($v)))
{
$v=wordwrap($v, $allowedLength, $cut, true);
}