diff options
author | Aleksander Machniak <alec@alec.pl> | 2019-12-18 13:54:20 +0300 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2019-12-18 13:54:20 +0300 |
commit | 9bb95471bf73ed623d68e969d9864ac988f83ee4 (patch) | |
tree | f03abbce1353d8c9e102417367e113226e109d21 /program | |
parent | 226097fc3fe87578e9bd987c18181524096723ba (diff) | |
parent | 52caed0d66532d167e3acf1d11237b3c1d7b451a (diff) |
Merge branch 'master' of github.com:roundcube/roundcubemail
Diffstat (limited to 'program')
-rw-r--r-- | program/steps/mail/func.inc | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc index ae396cff1..ed75b2d8a 100644 --- a/program/steps/mail/func.inc +++ b/program/steps/mail/func.inc @@ -839,12 +839,10 @@ function rcmail_wash_html($html, $p, $cid_replaces = array()) // washtml's DOMDocument methods cannot work without that $meta = '<meta charset="'.RCUBE_CHARSET.'" />'; - // remove old meta tag and add the new one, making sure - // that it is placed in the head (#1488093) - $html = preg_replace('/<meta[^>]+charset=[a-z0-9_"-]+[^>]*>/Ui', $meta, $html, -1, $rcount); - if (!$rcount) { - $html = preg_replace('/(<head[^>]*>)/Ui', '\\1'.$meta, $html, -1, $rcount); - } + // remove old meta tag and add the new one, making sure that it is placed in the head (#3510, #7116) + $html = preg_replace('/<meta[^>]+charset=[a-z0-9_"-]+[^>]*>/Ui', '', $html); + $html = preg_replace('/(<head[^>]*>)/Ui', '\\1'.$meta, $html, -1, $rcount); + if (!$rcount) { // Note: HTML without <html> tag may still be a valid input (#6713) if (($pos = stripos($html, '<html')) === false) { |