From 82bebe258890332ede4c53bfde362b13b971c6fc Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Tue, 14 Jul 2009 14:09:55 -0600 Subject: [PATCH] Fix Registry usage; fix missing trailing bracket if not using Registry --- .../Text_Filter/lib/Horde/Text/Filter/Emails.php | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/framework/Text_Filter/lib/Horde/Text/Filter/Emails.php b/framework/Text_Filter/lib/Horde/Text/Filter/Emails.php index 956266f57..1996fae71 100644 --- a/framework/Text_Filter/lib/Horde/Text/Filter/Emails.php +++ b/framework/Text_Filter/lib/Horde/Text/Filter/Emails.php @@ -73,9 +73,12 @@ class Horde_Text_Filter_Emails extends Horde_Text_Filter /eix EOR; - if (isset($GLOBALS['registry']) && - is_a($GLOBALS['registry'], 'Registry') && - $GLOBALS['registry']->hasMethod('mail/compose') && + if (class_exists('Horde_Registry')) { + $registry = Horde_Registry::singleton(); + } + + if ($registry && + $registry->hasMethod('mail/compose') && !$this->_params['always_mailto']) { /* If we have a mail/compose registry method, use it. */ $replacement = 'Horde_Text_Filter_Emails::callback(\'registry\', \'' @@ -96,9 +99,9 @@ EOR; . htmlspecialchars('$10$11') . '" title="' . sprintf(_("New Message to %s"), htmlspecialchars('$10')) . '">' . htmlspecialchars('$10$11') . '' + . htmlspecialchars('$14') EOP; - $replacement = 'chr(1).chr(1).chr(1).base64_encode(' - . $replacement . ').chr(1).chr(1).chr(1)'; + $replacement = 'chr(1).chr(1).chr(1).base64_encode(' . $replacement . ').chr(1).chr(1).chr(1)'; } else { $replacement = 'Horde_Text_Filter_Emails::callback(\'link\', \'' . $this->_params['encode'] . '\', \'' . $class @@ -133,9 +136,10 @@ EOP; parse_str($args, $extra); try { - $url = $GLOBALS['registry']->call('mail/compose', - array(array('to' => $email), - $extra)); + $registry = Horde_Registry::singleton(); + $url = $registry->call('mail/compose', + array(array('to' => $email), + $extra)); } catch (Horde_Exception $e) { $url = 'mailto:' . urlencode($email); } -- 2.11.0