diff --git a/phpgwapi/inc/class.html.inc.php b/phpgwapi/inc/class.html.inc.php index 7d07c59603..035ab9586f 100644 --- a/phpgwapi/inc/class.html.inc.php +++ b/phpgwapi/inc/class.html.inc.php @@ -1557,7 +1557,14 @@ egw_LAB.wait(function() { */ static function splithtmlByPRE($html) { - if (($pos = stripos($html,'
'; + $pos = stripos($html,$searchFor); + } + if ($pos === false) { return $html; } @@ -1567,7 +1574,13 @@ egw_LAB.wait(function() { $endofpre = stripos($html,'',$pos); $length = $endofpre-$pos+6; $html2ret[] = substr($html,$pos,$length); - $pos = stripos($html,'
'; + $pos = stripos($html,$searchFor, $endofpre+6); + } $html2ret[] = ($pos ? substr($html,$endofpre+6,$pos-($endofpre+6)): substr($html,$endofpre+6)); //$pos=false; } diff --git a/phpgwapi/inc/class.translation.inc.php b/phpgwapi/inc/class.translation.inc.php index da609c1109..6b293b3bf3 100644 --- a/phpgwapi/inc/class.translation.inc.php +++ b/phpgwapi/inc/class.translation.inc.php @@ -1264,12 +1264,12 @@ class translation // removing carriage return linefeeds, preserve those enclosed intags if ($stripcrl === true ) { - if (stripos($_html,'')!==false) { $contentArr = html::splithtmlByPRE($_html); foreach ($contentArr as $k =>&$elem) { - if (stripos($elem,'')===false) { //$elem = str_replace('@(\r\n)@i',' ',$elem); $elem = str_replace(array("\r\n","\n"),($isHTML?'':' '),$elem); @@ -1326,12 +1326,12 @@ class translation // reducing double \r\n to single ones, dont mess with pre sections if ($stripcrl === true && $isHTML) { - if (stripos($_html,'')!==false) { $contentArr = html::splithtmlByPRE($_html); foreach ($contentArr as $k =>&$elem) { - if (stripos($elem,'')===false) { //this is supposed to strip out all remaining stuff in tags, this is sometimes taking out whole sections off content if ( $stripalltags ) {