Skip to content

Commit

Permalink
Fixed issue #5355: UTF-8 linebreak breaking conditions editor
Browse files Browse the repository at this point in the history
git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey@10589 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
c-schmitz committed Jul 25, 2011
1 parent 3ff4458 commit 582e1bd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
5 changes: 1 addition & 4 deletions admin/conditionshandling.php
Expand Up @@ -1082,10 +1082,7 @@
{
foreach($canswers as $can)
{
$an=str_replace("'", "`", $can[2]);
$an=str_replace("\r", " ", $an);
$an=str_replace("\n", " ", $an);
$an=strip_tags($an);
$an=FlattenText($can[2]);
$conditionsoutput_main_content .= "Fieldnames[$jn]='$can[0]';\n"
."Codes[$jn]='$can[1]';\n"
."Answers[$jn]='$an';\n";
Expand Down
8 changes: 7 additions & 1 deletion common_functions.php
Expand Up @@ -4346,8 +4346,14 @@ function FlattenText($sTextToFlatten, $bDecodeHTMLEntities=false, $sCharset='UTF
$sNicetext = strip_tags($sNicetext);
if($is_csv==true)
$sNicetext = str_replace(array("\r\n","\r","\n"),array(PHP_EOL,PHP_EOL,PHP_EOL), $sNicetext);
elseif ($sCharset=='UTF-8')
{
$sNicetext = preg_replace('/\v/u', '', $sNicetext);
}
else
$sNicetext = str_replace(array("\n","\r"),array('',''), $sNicetext);
{
$sNicetext = str_replace(array("\n","\r"),array('',''), $sNicetext);
}
if ($bDecodeHTMLEntities==true)
{
$sNicetext = str_replace(' ',' ', $sNicetext); // html_entity_decode does not properly convert   to spaces
Expand Down

0 comments on commit 582e1bd

Please sign in to comment.