diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2011-11-24 14:51:43 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2011-11-24 14:51:43 +0000 |
| commit | fb9e05873a0832c0ab22538bf0612b7abfbb70c5 (patch) | |
| tree | 8237eee04c1450beb36900b0512cb7cad96cb144 /roundcubemail/program/include | |
| parent | 8b3f0c7fb9485f79298e3a04b4b461dc0a9f756f (diff) | |
- Performance improvements
git-svn-id: https://svn.roundcube.net/trunk@5486 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/include')
| -rw-r--r-- | roundcubemail/program/include/rcube_imap.php | 8 | ||||
| -rwxr-xr-x | roundcubemail/program/include/rcube_template.php | 6 |
2 files changed, 10 insertions, 4 deletions
diff --git a/roundcubemail/program/include/rcube_imap.php b/roundcubemail/program/include/rcube_imap.php index a0a5f8189..50656f28c 100644 --- a/roundcubemail/program/include/rcube_imap.php +++ b/roundcubemail/program/include/rcube_imap.php @@ -2416,10 +2416,12 @@ class rcube_imap // convert charset (if text or message part) if ($body && preg_match('/^(text|message)$/', $o_part->ctype_primary)) { - // Remove NULL characters (#1486189) - $body = str_replace("\x00", '', $body); + // Remove NULL characters if any (#1486189) + if (strpos($body, "\x00") !== false) { + $body = str_replace("\x00", '', $body); + } - if (!$skip_charset_conv) { + if (!$skip_charset_conv) { if (!$o_part->charset || strtoupper($o_part->charset) == 'US-ASCII') { // try to extract charset information from HTML meta tag (#1488125) if ($o_part->ctype_secondary == 'html' && preg_match('/<meta[^>]+charset=([a-z0-9-_]+)/i', $body, $m)) diff --git a/roundcubemail/program/include/rcube_template.php b/roundcubemail/program/include/rcube_template.php index ea221767c..df10ac116 100755 --- a/roundcubemail/program/include/rcube_template.php +++ b/roundcubemail/program/include/rcube_template.php @@ -434,7 +434,11 @@ class rcube_template extends rcube_html_page // trigger generic hook where plugins can put additional content to the page $hook = $this->app->plugins->exec_hook("render_page", array('template' => $realname, 'content' => $output)); - $output = $this->parse_with_globals($hook['content']); + // save some memory + $output = $hook['content']; + unset($hook['content']); + + $output = $this->parse_with_globals($output); // make sure all <form> tags have a valid request token $output = preg_replace_callback('/<form\s+([^>]+)>/Ui', array($this, 'alter_form_tag'), $output); |
