summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2006-11-09 19:06:37 +0000
committerthomascube <thomas@roundcube.net>2006-11-09 19:06:37 +0000
commit674a0fb41dc80c7d1a99339481339ac6e5f75004 (patch)
treebace6691325da4b5a8fab713e6bcbeb780434044 /program
parent03ac2132e2962755e4359f8a5ab3ffcee36c13b1 (diff)
Corrected template parsing and output encoding
Diffstat (limited to 'program')
-rw-r--r--program/include/main.inc5
-rw-r--r--program/include/rcube_shared.inc3
2 files changed, 5 insertions, 3 deletions
diff --git a/program/include/main.inc b/program/include/main.inc
index b2e83b767..676883305 100644
--- a/program/include/main.inc
+++ b/program/include/main.inc
@@ -958,8 +958,9 @@ function rep_specialchars_output($str, $enctype='', $mode='', $newlines=TRUE)
}
else if ($mode=='remove')
$str = strip_tags($str);
-
- $out = strtr($str, $encode_arr);
+
+ // avoid douple quotation of &
+ $out = preg_replace('/&amp;([a-z]{2,5});/', '&\\1;', strtr($str, $encode_arr));
return $newlines ? nl2br($out) : $out;
}
diff --git a/program/include/rcube_shared.inc b/program/include/rcube_shared.inc
index 11af48205..7f3771b08 100644
--- a/program/include/rcube_shared.inc
+++ b/program/include/rcube_shared.inc
@@ -215,7 +215,8 @@ class rcube_html_page
if(($fpos = strrpos($output_lc, '</body>')) ||
($fpos = strrpos($output_lc, '</html>')))
{
- $output = substr($output,0,$fpos) . "$__page_footer\n" . substr($output,$fpos,strlen($output));
+ $fpos -= 8;
+ $output = substr($output,0,$fpos) . "$__page_footer\n" . substr($output,$fpos);
}
else
$output .= "\n$__page_footer";