Fix so rcube_text2html class does not depend on rcmail_string_replacer

pull/187/head
Aleksander Machniak 10 years ago
parent fec4f240e5
commit 9cc5a522df

@ -57,6 +57,8 @@ class rcube_text2html
'end' => '</div>',
// enables links replacement
'links' => true,
// string replacer class
'replacer' => 'rcube_string_replacer',
);
@ -141,7 +143,7 @@ class rcube_text2html
{
// make links and email-addresses clickable
$attribs = array('link_attribs' => array('rel' => 'noreferrer', 'target' => '_blank'));
$replacer = new rcmail_string_replacer($attribs);
$replacer = new $this->config['replacer']($attribs);
if ($this->config['flowed']) {
$flowed_char = 0x01;

@ -920,7 +920,7 @@ function rcmail_print_body($part, $p = array())
*/
function rcmail_plain_body($body, $flowed = false)
{
$options = array('flowed' => $flowed, 'wrap' => !$flowed);
$options = array('flowed' => $flowed, 'wrap' => !$flowed, 'replacer' => 'rcmail_string_replacer');
$text2html = new rcube_text2html($body, false, $options);
$body = $text2html->get_html();

Loading…
Cancel
Save