Skip to content

Commit

Permalink
Fixed issue #7661: Capital 'R' missing in certain title elements in a…
Browse files Browse the repository at this point in the history
…dministration
  • Loading branch information
c-schmitz committed Mar 17, 2013
1 parent d69bf21 commit feb8990
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions application/helpers/common_helper.php
Expand Up @@ -4591,11 +4591,19 @@ function flattenText($sTextToFlatten, $keepSpan=false, $bDecodeHTMLEntities=fals
else {
$sNicetext = strip_tags($sNicetext);
}
// ~\R~u : see "What \R matches" and "Newline sequences" in http://www.pcre.org/pcre.txt
// ~\R~u : see "What \R matches" and "Newline sequences" in http://www.pcre.org/pcre.txt - only available since PCRE 7.0
if ($bStripNewLines ){ // strip new lines
$sNicetext = preg_replace(array('~\R~u'),array(' '), $sNicetext);
if (version_compare(substr(PCRE_VERSION,0,strpos(PCRE_VERSION,' ')),'7.0')>-1)
{
$sNicetext = preg_replace(array('~\R~u'),array(' '), $sNicetext);
}
else
{
// Poor man's replacement for line feeds
$sNicetext = str_replace(array("\r\n","\n", "\r"), array(' ',' ',' '), $sNicetext);
}
}
else // unify newlines to \r\n
elseif (version_compare(substr(PCRE_VERSION,0,strpos(PCRE_VERSION,' ')),'7.0')>-1)// unify newlines to \r\n
{
$sNicetext = preg_replace(array('~\R~u'), array("\r\n"), $sNicetext);
}
Expand Down

0 comments on commit feb8990

Please sign in to comment.