Create Horde_Text_Filter binder/factory.
authorMichael M Slusarz <slusarz@curecanti.org>
Mon, 19 Jul 2010 21:52:23 +0000 (15:52 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Tue, 20 Jul 2010 21:15:36 +0000 (15:15 -0600)
73 files changed:
agora/lib/Messages.php
ansel/lib/Ajax/Imple/EditCaption.php
ansel/lib/Storage.php
ansel/lib/Tile/Image.php
ansel/lib/View/Base.php
ansel/templates/captions/captions.inc
ansel/templates/image/crop_image.inc
ansel/templates/image/edit_image.inc
ansel/templates/image/preview_cropimage.inc
ansel/templates/image/preview_image.inc
ansel/templates/image/resize_image.inc
ansel/templates/view/gallery.inc
ansel/templates/view/gallerylightbox.inc
ansel/templates/view/image.inc
chora/annotate.php
chora/browsedir.php
chora/cvsgraph.php
chora/diff.php
chora/history.php
chora/lib/Chora.php
chora/stats.php
chora/templates/checkout/checkout.inc
folks/lib/Driver.php
folks/lib/Forms/Activity.php
folks/lib/Notification/facebook.php
framework/Core/lib/Horde.php
framework/Core/lib/Horde/Config.php
framework/Core/lib/Horde/Core/Binder/TextFilter.php [new file with mode: 0644]
framework/Core/lib/Horde/Core/Factory/TextFilter.php [new file with mode: 0644]
framework/Core/lib/Horde/Core/Text/Filter/Emails.php
framework/Core/lib/Horde/Registry.php
framework/Core/lib/Horde/Themes.php
framework/Core/package.xml
framework/Mime/lib/Horde/Mime/Mail.php
framework/Rampage/scripts/Horde/Rampage/rampage.php
framework/Text_Filter/lib/Horde/Text/Filter.php
framework/Text_Filter/lib/Horde/Text/Filter/Emails.php
framework/Text_Filter/lib/Horde/Text/Filter/Text2html.php
framework/Text_Filter/test/Horde/Text/Filter/emails.phpt
horde/lib/Block/fortune.php
horde/lib/Block/twitter_timeline.php
horde/services/twitter.php
horde/templates/javascript/open_html_helper.js
imp/lib/Compose.php
imp/lib/Contents.php
imp/lib/IMP.php
imp/lib/Mime/Viewer/Html.php
imp/lib/Mime/Viewer/Pgp.php
imp/lib/Mime/Viewer/Plain.php
imp/lib/Prefs/Ui.php
imp/lib/Ui/Compose.php
imp/lib/Ui/Mailbox.php
imp/lib/Ui/Message.php
imp/mailbox.php
imp/message-mimp.php
imp/view.php
ingo/lib/Ingo.php
jonah/delivery/rss.php
jonah/lib/Api.php
jonah/lib/Block/latest.php
jonah/lib/Block/story.php
jonah/lib/Driver.php
jonah/lib/News.php
jonah/stories/pdf.php
jonah/stories/view.php
kronolith/templates/itip/notification.html.php
kronolith/templates/view/view.inc
luxor/lib/Lang/Generic.php
luxor/lib/Luxor.php
mnemo/lib/Block/note.php
mnemo/templates/view/memo.inc
nag/lib/Task.php
whups/lib/Renderer/Comment.php

index 570fbda..c08dcaf 100644 (file)
@@ -1063,7 +1063,7 @@ class Agora_Messages {
             $filters_params[0]['parselevel'] = Horde_Text_Filter_Text2html::NOHTML;
         }
 
-        return Horde_Text_Filter::filter($body, $filters, $filters_params);
+        return $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($body, $filters, $filters_params);
     }
 
     /**
@@ -1148,7 +1148,7 @@ class Agora_Messages {
             $message['message_id'] = $id;
             $message['message_author'] = htmlspecialchars($message['message_author']);
             $message['message_subject'] = htmlspecialchars($this->convertFromDriver($message['message_subject']), ENT_COMPAT, $GLOBALS['registry']->getCharset());
-            $message['message_body'] = Horde_Text_Filter::filter($this->convertFromDriver($message['body']), 'highlightquotes');
+            $message['message_body'] = $GLOBALS['injector']->getInstance('Horde_Text_Filter')filter($this->convertFromDriver($message['body']), 'highlightquotes');
             if ($message['attachments']) {
                 $message['message_attachment'] = $this->getAttachmentLink($id);
             }
index 65f2e5d..799f1de 100644 (file)
@@ -76,10 +76,10 @@ class Ansel_Ajax_Imple_EditCaption extends Horde_Core_Ajax_Imple
                     return '';
                 }
             }
-            $imageCaption = Horde_Text_Filter::filter(
-                $image->caption, 'text2html',
+            return $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter(
+                $image->caption,
+                'text2html',
                 array('parselevel' => Horde_Text_Filter_Text2html::MICRO));
-            return $imageCaption;
         }
     }
 
index f4cbdea..5b9b5ec 100644 (file)
@@ -966,7 +966,7 @@ class Ansel_Storage
             if ($galleries[$gallery_id]['perm']) {
                 $data = array((string)Ansel::getImageUrl($image->id, $image_view, $full, $style),
                     htmlspecialchars($image->filename, ENT_COMPAT, $GLOBALS['registry']->getCharset()),
-                    Horde_Text_Filter::filter($image->caption, 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO_LINKURL)),
+                    $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($image->caption, 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO_LINKURL)),
                     $image->id,
                     0);
 
index 179254d..8eacff0 100644 (file)
@@ -101,7 +101,7 @@ class Ansel_Tile_Image
                 ? str_replace('%i', $image->id, $params['image_onclick'])
                 : '');
 
-        $imageCaption = Horde_Text_Filter::filter(
+        $imageCaption = $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter(
             $image->caption, 'text2html',
             array('parselevel' => Horde_Text_Filter_Text2html::MICRO));
 
index 2e56ced..93da194 100644 (file)
@@ -260,7 +260,7 @@ abstract class Ansel_View_Base
 
             $data = array((string)Ansel::getImageUrl($image->id, $params['image_view'], $params['full'], $style['name']),
                           htmlspecialchars($image->filename, ENT_COMPAT, $GLOBALS['registry']->getCharset()),
-                          Horde_Text_Filter::filter($image->caption, 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO_LINKURL)),
+                          $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($image->caption, 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO_LINKURL)),
                           $image->id,
                           $curpage);
             if ($params['view_links']) {
index cc14724..ad48c75 100644 (file)
@@ -12,7 +12,7 @@
 
 <?php if ($gallery->get('desc')): ?>
 <p class="box">
- <?php echo Horde_Text_Filter::filter($gallery->get('desc'), 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO)) ?>
+ <?php echo $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($gallery->get('desc'), 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO)) ?>
 </p>
 <?php endif; ?>
 
index 83cff1f..4055440 100644 (file)
@@ -120,7 +120,7 @@ echo $selfUrl->copy()->add('actionID', 'resizeedit')->link() . Horde::img('image
     <?php echo '<img src="' . $image_src . '" id="edit_image" alt="[image]" />' ?>
   </div>
   <br />
-    <?php $caption = $image->caption ? $image->caption : $image->filename; echo Horde_Text_Filter::filter($caption, 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO)) ?>
+    <?php $caption = $image->caption ? $image->caption : $image->filename; echo $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($caption, 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO)) ?>
 </div>
 <div style="text-align:center;width:25%;float:left;position:relative;">
 <form method="post" action="<?php echo $imageurl->copy()->add('actionID', 'previewcrop');?>">
index 138878f..f24b5de 100644 (file)
@@ -35,5 +35,5 @@ echo $selfUrl->copy()->add('actionID', 'resizeedit')->link() . Horde::img('image
 <div style="text-align: center;">
   <?php echo '<img src="' . $image_src . '" id="edit_image" alt="[image]" />' ?>
   <br />
-  <?php $caption = $image->caption ? $image->caption : $image->filename; echo Horde_Text_Filter::filter($caption, 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO)) ?>
+  <?php $caption = $image->caption ? $image->caption : $image->filename; echo $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($caption, 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO)) ?>
 </div>
index f312f30..f3fb6af 100644 (file)
@@ -30,5 +30,5 @@ if ($gallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT))
 <div align="center">
 <?php echo '<img src="' . $image_url . '" alt="[preview]" />'?>
 <br />
-<?php $caption = $image->caption ? $image->caption : $image->filename; echo Horde_Text_Filter::filter($caption, 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO)) ?>
+<?php $caption = $image->caption ? $image->caption : $image->filename; echo $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($caption, 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO)) ?>
 </div>
index e5d564f..358752f 100644 (file)
@@ -32,5 +32,5 @@ if ($gallery->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT))
 <div align="center">
 <?php echo '<img src="' . $image_url . '" alt="[preview]" />' ?>
 <br />
-<?php $caption = $image->caption ? $image->caption : $image->filename; echo Horde_Text_Filter::filter($caption, 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO)) ?>
+<?php $caption = $image->caption ? $image->caption : $image->filename; echo $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($caption, 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO)) ?>
 </div>
index 2ff1d72..69f82ed 100644 (file)
@@ -79,5 +79,5 @@ echo $selfUrl->copy()->add(array('actionID' => 'resizeedit'))->link() . Horde::i
 <div style="width: 100%;float:left;text-align: center;padding-top:10px;">
  <?php echo '<img src="' . $image_src . '" id="edit_image" alt="[image]" />' ?>
  <br />
- <?php $caption = $image->caption ? $image->caption : $image->filename; echo Horde_Text_Filter::filter($caption, 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO)) ?>
+ <?php $caption = $image->caption ? $image->caption : $image->filename; echo $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($caption, 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO)) ?>
 </div>
index 54d6b2f..9d5f9c9 100644 (file)
@@ -109,7 +109,7 @@ function downloadSelected()
 </div>
 <?php if ($this->view->gallery->get('desc')): ?>
     <div id="galleryDescription" class="gallery-desc">
-    <?php echo Horde_Text_Filter::filter($this->view->gallery->get('desc'), 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO)) ?>
+    <?php echo $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($this->view->gallery->get('desc'), 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO)) ?>
     </div>
 <?php endif; ?>
 <table cellspacing="0" width="100%">
index 49eea91..e4dbf22 100644 (file)
@@ -126,7 +126,7 @@ function downloadSelected()
 </div>
 <?php if ($this->view->gallery->get('desc')): ?>
 <div class="gallery-desc" id="galleryDescription">
-<?php echo Horde_Text_Filter::filter($this->view->gallery->get('desc'), 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO)) ?>
+<?php echo $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($this->view->gallery->get('desc'), 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO)) ?>
 </div>
 <?php endif;?>
 <table width="100%" cellspacing="0">
index fd3b4b5..5e7a619 100644 (file)
@@ -105,7 +105,7 @@ function arrowHandler(e)
      <?php echo Horde::img('blank.gif', '', array('id' => 'photodiv', 'width' => $this->_geometry['width'], 'height' => $this->_geometry['height'])) ?>
      <div id="CaptionContainer" style="width:<?php echo $this->_geometry['width']?>px;">
      <p id="Caption" style="display:none;">
-       <?php echo Horde_Text_Filter::filter($this->resource->caption, 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO)) ?>
+       <?php echo $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($this->resource->caption, 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO)) ?>
      </p>
      </div>
     </div>
index 1a8d776..f07bff4 100644 (file)
@@ -42,7 +42,7 @@ try {
     Chora::fatal($e);
 }
 
-$title = sprintf(_("Source Annotation of %s (revision %s)"), Horde_Text_Filter::filter($where, 'space2html', array('charset' => $GLOBALS['registry']->getCharset(), 'encode' => true, 'encode_all' => true)), $rev);
+$title = sprintf(_("Source Annotation of %s (revision %s)"), $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($where, 'space2html', array('encode' => true, 'encode_all' => true)), $rev);
 $extraLink = sprintf('<a href="%s">%s</a> | <a href="%s">%s</a>',
                      Chora::url('co', $where, array('r' => $rev)), _("View"),
                      Chora::url('co', $where, array('r' => $rev, 'p' => 1)), _("Download"));
@@ -72,7 +72,7 @@ while (list(,$line) = each($lines)) {
     }
     $prev = $fl->queryPreviousRevision($rev);
 
-    $line = Horde_Text_Filter::filter($line['line'], 'space2html', array('charset' => $GLOBALS['registry']->getCharset(), 'encode' => true, 'encode_all' => true));
+    $line = $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($line['line'], 'space2html', array('encode' => true, 'encode_all' => true));
     include CHORA_TEMPLATES . '/annotate/line.inc';
 }
 
index 5d7bae5..b0de3f2 100644 (file)
@@ -88,7 +88,7 @@ if ($dirList) {
             continue;
         }
         $url = Chora::url('browsedir', $where . '/' . $currentDir . '/', array('onb' => $onb));
-        $currDir = Horde_Text_Filter::filter($currentDir, 'space2html', array('charset' => $GLOBALS['registry']->getCharset(), 'encode' => true, 'encode_all' => true));
+        $currDir = $injector->getInstance('Horde_Text_Filter')->filter($currentDir, 'space2html', array('encode' => true, 'encode_all' => true));
         require CHORA_TEMPLATES . '/directory/dir.inc';
     }
     echo '</tbody>';
@@ -115,7 +115,7 @@ if ($fileList) {
         $log = $lg->queryLog();
         $attic = $currFile->isDeleted();
         $fileName = $where . ($attic ? '/' . 'Attic' : '') . '/' . $realname;
-        $name = Horde_Text_Filter::filter($realname, 'space2html', array('charset' => $GLOBALS['registry']->getCharset(), 'encode' => true, 'encode_all' => true));
+        $name = $injector->getInstance('Horde_Text_Filter')->filter($realname, 'space2html', array('encode' => true, 'encode_all' => true));
         $url = Chora::url('browsefile', $fileName, array('onb' => $onb));
         $readableDate = Chora::readableTime($date);
         if ($log) {
index 3776e59..5be547f 100644 (file)
@@ -49,7 +49,7 @@ if (Horde_Util::getFormData('show_image')) {
     passthru($conf['paths']['cvsgraph'] . ' ' . $argstr . ' ' . $file);
 } else {
     // Display the wrapper page for the image.
-    $title = sprintf(_("Graph for %s"), Horde_Text_Filter::filter($where, 'space2html', array('charset' => $GLOBALS['registry']->getCharset(), 'encode' => true, 'encode_all' => true)));
+    $title = sprintf(_("Graph for %s"), $injector->getInstance('Horde_Text_Filter')->filter($where, 'space2html', array('encode' => true, 'encode_all' => true)));
     $extraLink = Chora::getFileViews($where, 'cvsgraph');
 
     require CHORA_TEMPLATES . '/common-header.inc';
index ccf9e56..bbd9318 100644 (file)
@@ -55,7 +55,7 @@ if ($type != 'colored') {
 $abbrev_r1 = $VC->abbrev($r1);
 $abbrev_r2 = $VC->abbrev($r2);
 $title = sprintf(_("Diff for %s between version %s and %s"),
-                 Horde_Text_Filter::filter($where, 'space2html', array('charset' => $GLOBALS['registry']->getCharset(), 'encode' => true, 'encode_all' => true)), $abbrev_r1, $abbrev_r2);
+                 $injector->getInstance('Horde_Text_Filter')->filter($where, 'space2html', array('encode' => true, 'encode_all' => true)), $abbrev_r1, $abbrev_r2);
 
 /* Format log entries. */
 $log_messages = array();
index 11e6035..6e2a5ec 100644 (file)
@@ -127,7 +127,7 @@ foreach ($grid as $cols) {
     $maxCol = max($val, $maxCol);
 }
 
-$title = sprintf(_("Source Branching View for %s"), Horde_Text_Filter::filter($where, 'space2html', array('charset' => $GLOBALS['registry']->getCharset(), 'encode' => true, 'encode_all' => true)));
+$title = sprintf(_("Source Branching View for %s"), $injector->getInstance('Horde_Text_Filter')->filter($where, 'space2html', array('encode' => true, 'encode_all' => true)));
 $extraLink = Chora::getFileViews($where, 'history');
 
 require CHORA_TEMPLATES . '/common-header.inc';
index 864738e..aaa72d8 100644 (file)
@@ -60,7 +60,7 @@ class Chora
                 if (!empty($onb)) {
                     $url = Horde_Util::addParameter($url, array('onb' => $onb));
                 }
-                $bar .= '/ <a href="' . $url . '">'. Horde_Text_Filter::filter($dir, 'space2html', array('charset' => $GLOBALS['registry']->getCharset(), 'encode' => true, 'encode_all' => true)) . '</a> ';
+                $bar .= '/ <a href="' . $url . '">' . $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($dir, 'space2html', array('encode' => true, 'encode_all' => true)) . '</a> ';
             }
         }
 
@@ -467,7 +467,7 @@ class Chora
      */
     static public function formatLogMessage($log)
     {
-        $log = Horde_Text_Filter::filter($log, 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO, 'charset' => $GLOBALS['registry']->getCharset(), 'class' => ''));
+        $log = $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($log, 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO));
 
         return (empty($GLOBALS['conf']['tickets']['regexp']) || empty($GLOBALS['conf']['tickets']['replacement']))
             ? $log
index ba53919..a1cd819 100644 (file)
@@ -29,7 +29,7 @@ foreach ($fl->queryLogs() as $lg) {
 }
 arsort($stats);
 
-$title = sprintf(_("Statistics for %s"), Horde_Text_Filter::filter($where, 'space2html', array('charset' => $GLOBALS['registry']->getCharset(), 'encode' => true, 'encode_all' => true)));
+$title = sprintf(_("Statistics for %s"), $injector->getInstance('Horde_Text_Filter')->filter($where, 'space2html', array('encode' => true, 'encode_all' => true)));
 Horde::addScriptFile('tables.js', 'horde');
 require CHORA_TEMPLATES . '/common-header.inc';
 require CHORA_TEMPLATES . '/menu.inc';
index 2aabd0e..9ac7a5d 100644 (file)
@@ -21,7 +21,7 @@
 if (strpos($mime_type, 'text/plain') !== false) {
     $data = $pretty->render('inline');
     $data = reset($data);
-    echo '<div class="fixed">' . Horde_Text_Filter::filter($data['data'], 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO)) . '</div>';
+    echo '<div class="fixed">' . $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($data['data'], 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO)) . '</div>';
 } elseif (strpos($mime_type, 'image/') !== false) {
     echo Horde::img(Horde_Util::addParameter(Horde::selfUrl(true), 'p', 1), '', '', '');
 } elseif ($pretty->canRender('inline')) {
index d9ffa30..38647f9 100644 (file)
@@ -319,7 +319,6 @@ class Folks_Driver {
             $profile = unserialize($profile);
 
         } else {
-
             // Load profile
             $profile = $this->_getProfile($user);
             if ($profile instanceof PEAR_Error) {
@@ -338,7 +337,7 @@ class Folks_Driver {
                 $filters_params[0]['parselevel'] = Horde_Text_Filter_Text2html::NOHTML;
             }
 
-            $profile['user_description'] = Horde_Text_Filter::filter(trim($profile['user_description']), $filters, $filters_params);
+            $profile['user_description'] = $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter(trim($profile['user_description']), $filters, $filters_params);
 
             // Get user last external data
             foreach ($profile as $key => $value) {
index 90f98af..60e7f1b 100644 (file)
@@ -48,7 +48,7 @@ class Folks_Activity_Form extends Horde_Form {
             $filters_params[0]['parselevel'] = Horde_Text_Filter_Text2html::NOHTML;
         }
 
-        $message = Horde_Text_Filter::filter(trim($message), $filters, $filters_params);
+        $message = $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter(trim($message), $filters, $filters_params);
 
         $result = $GLOBALS['folks_driver']->logActivity($message, 'folks:custom');
         if ($result instanceof PEAR_Error) {
index fbc82bc..1784488 100644 (file)
@@ -158,6 +158,6 @@ class Folks_Notification_facebook extends Folks_Notification {
     private function _formatBody($subject, $body)
     {
         return '<b>' . $subject . ':</b> '
-                . Horde_Text_Filter::filter($body, 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO_LINKURL));
+                . $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($body, 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO_LINKURL));
     }
 }
index 6cfe9f4..075f05b 100644 (file)
@@ -319,7 +319,7 @@ HTML;
                         /* Separate JS files with a newline since some
                          * compressors may strip trailing terminators. */
                         try {
-                            $out .= Horde_Text_Filter::filter($js_text, 'JavascriptMinify', $jsmin_params) . "\n";
+                            $out .= $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($js_text, 'JavascriptMinify', $jsmin_params) . "\n";
                         } catch (Horde_Exception $e) {
                             $out .= $js_text . "\n";
                         }
index 172e14c..6c93060 100644 (file)
@@ -415,7 +415,7 @@ class Horde_Config
                 continue;
             }
             $name = $node->getAttribute('name');
-            $desc = Horde_Text_Filter::filter($node->getAttribute('desc'), 'linkurls', array('callback' => 'Horde::externalUrl'));
+            $desc = $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($node->getAttribute('desc'), 'linkurls');
             $required = !($node->getAttribute('required') == 'false');
             $quote = !($node->getAttribute('quote') == 'false');
 
@@ -431,7 +431,7 @@ class Horde_Config
 
                 $conf[$name] = array(
                     '_type' => 'description',
-                    'desc' => Horde_Text_Filter::filter($this->_default($curctx, $this->_getNodeOnlyText($node)), 'linkurls', array('callback' => 'Horde::externalUrl'))
+                    'desc' => $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($this->_default($curctx, $this->_getNodeOnlyText($node)), 'linkurls')
                 );
                 break;
 
diff --git a/framework/Core/lib/Horde/Core/Binder/TextFilter.php b/framework/Core/lib/Horde/Core/Binder/TextFilter.php
new file mode 100644 (file)
index 0000000..e3bcc3c
--- /dev/null
@@ -0,0 +1,17 @@
+<?php
+/**
+ * @category Horde
+ * @package  Core
+ */
+class Horde_Core_Binder_TextFilter implements Horde_Injector_Binder
+{
+    public function create(Horde_Injector $injector)
+    {
+        return new Horde_Core_Factory_TextFilter($injector);
+    }
+
+    public function equals(Horde_Injector_Binder $binder)
+    {
+        return false;
+    }
+}
diff --git a/framework/Core/lib/Horde/Core/Factory/TextFilter.php b/framework/Core/lib/Horde/Core/Factory/TextFilter.php
new file mode 100644 (file)
index 0000000..48929e9
--- /dev/null
@@ -0,0 +1,148 @@
+<?php
+/**
+ * A Horde_Injector:: based Horde_Text_Filter_Base:: factory.
+ *
+ * PHP version 5
+ *
+ * @category Horde
+ * @package  Core
+ * @author   Michael Slusarz <slusarz@horde.org>
+ * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @link     http://pear.horde.org/index.php?package=Core
+ */
+
+/**
+ * A Horde_Injector:: based Horde_Text_Filter_Base:: factory.
+ *
+ * Copyright 2010 The Horde Project (http://www.horde.org/)
+ *
+ * See the enclosed file COPYING for license information (LGPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
+ *
+ * @category Horde
+ * @package  Core
+ * @author   Michael Slusarz <slusarz@horde.org>
+ * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @link     http://pear.horde.org/index.php?package=Core
+ */
+class Horde_Core_Factory_TextFilter
+{
+    /**
+     * The injector.
+     *
+     * @var Horde_Injector
+     */
+    private $_injector;
+
+    /**
+     * Constructor.
+     *
+     * @param Horde_Injector $injector  The injector to use.
+     */
+    public function __construct(Horde_Injector $injector)
+    {
+        $this->_injector = $injector;
+    }
+
+    /**
+     * Return the Horde_Text_Filter_Base:: instance.
+     *
+     * @param string $driver  Either a driver name, or the full class name to
+     *                        use.
+     * @param array $params   A hash containing any additional configuration
+     *                        parameters a subclass might need.
+     *
+     * @return Horde_Text_Filter_Base  The singleton instance.
+     * @throws Horde_Text_Filter_Exception
+     */
+    public function getFilter($driver, array $params = array())
+    {
+        list($driver, $params) = $this->_getDriver($driver, $params);
+        return Horde_Text_Filter::factory($driver, $params);
+    }
+
+    /**
+     * Applies a set of patterns to a block of text.
+     *
+     * @param string $text    The text to filter.
+     * @param mixed $filters  The list of filters (or a single filter).
+     * @param mixed $params   The list of params to use with each filter.
+     *
+     * @return string  The transformed text.
+     */
+    public function filter($text, $filters = array(), array $params = array())
+    {
+        if (!is_array($filters)) {
+            $filters = array($filters);
+            $params = array($params);
+        }
+
+        $filter_list = array();
+        $params = array_values($params);
+
+        foreach (array_values($filters) as $num => $filter) {
+            list($driver, $driv_param) = $this->_getDriver($filter, isset($params[$num]) ? $params[$num] : array());
+            $filter_list[$driver] = $driv_param;
+        }
+
+        return Horde_Text_Filter::filter($text, array_keys($filter_list), array_values($filter_list));
+    }
+
+    /**
+     * Gets the driver/params for a given base Horde_Text_Filter driver.
+     *
+     * @param string $driver  Either a driver name, or the full class name to
+     *                        use.
+     * @param array $params   A hash containing any additional configuration
+     *                        parameters a subclass might need.
+     *
+     * @return array  Driver as the first value, params list as the second.
+     */
+    protected function _getDriver($driver, $params)
+    {
+        $lc_driver = Horde_String::lower($driver);
+
+        switch ($lc_driver) {
+        case 'emails':
+            $driver = 'Horde_Core_Text_Filter_Emails';
+            break;
+
+        case 'emoticons':
+            $driver = 'Horde_Core_Text_Filter_Emoticons';
+            break;
+
+        case 'linkurls':
+            if (!isset($params['callback'])) {
+                $params['callback'] = 'Horde::externalUrl';
+            }
+            break;
+
+        case 'text2html':
+            $param_copy = $params;
+            foreach (array('emails', 'linkurls', 'space2html') as $val) {
+                if (!isset($params[$val])) {
+                    $tmp = $this->_getDriver($val, $param_copy);
+                    $params[$val] = array(
+                        $tmp[0] => $tmp[1]
+                    );
+                }
+            }
+            break;
+        }
+
+        /* Add charset information, if needed. */
+        if (!isset($params['charset'])) {
+            switch ($lc_driver) {
+            case 'cleanhtml':
+            case 'html2text':
+            case 'space2html':
+            case 'text2html':
+                $params['charset'] = $GLOBALS['registry']->getCharset();
+                break;
+            }
+        }
+
+        return array($driver, $params);
+    }
+
+}
index 2e0d978..30ff3c9 100644 (file)
@@ -50,14 +50,14 @@ class Horde_Core_Text_Filter_Emails extends Horde_Text_Filter_Emails
             return parent::_regexCallback($matches);
         }
 
-        if (empty($email2)) {
+        if ($matches[10] === '') {
             $args = $matches[7];
             $email = $matches[3];
             $args_long = $matches[5];
         } else {
-            $args = $matches[13];
+            $args = isset($matches[13]) ? $matches[13] : '';
             $email = $matches[10];
-            $args_long = $matches[11];
+            $args_long = isset($matches[11]) ? $matches[11] : '';
         }
 
         parse_str($args, $extra);
@@ -71,7 +71,7 @@ class Horde_Core_Text_Filter_Emails extends Horde_Text_Filter_Emails
             $href = '#';
             $onclick = ' onclick="' . substr($url, 11) . ';return false;"';
         } else {
-            $href = $url;
+            $href = htmlspecialchars($url);
             $onclick = '';
         }
 
@@ -79,10 +79,9 @@ class Horde_Core_Text_Filter_Emails extends Horde_Text_Filter_Emails
             ? ''
             : ' class="' . $this->_params['class'] . '"';
 
-        return $matches[1] . $matches[2] . $matches[9] . '<a' . $class .
-            ' href="' . $href . '"' . $onclick . '>' .
-            htmlspecialchars($email) . $args_long
-            . '</a>' . $matches[8] . $matches[4] . ($matches[14] ? '>' : '');
+        return '<a' . $class .' href="' . $href . '"' . $onclick . '>' .
+            htmlspecialchars($email) . htmlspecialchars($args_long) .
+            '</a>';
     }
 
 }
index b1fd524..387805e 100644 (file)
@@ -290,6 +290,7 @@ class Horde_Registry
             'Horde_SessionHandler' => new Horde_Core_Binder_SessionHandler(),
             'Horde_Share' => new Horde_Core_Binder_Share(),
             'Horde_Template' => new Horde_Core_Binder_Template(),
+            'Horde_Text_Filter' => new Horde_Core_Binder_TextFilter(),
             'Horde_Tree' => new Horde_Core_Binder_Tree(),
             'Horde_Token' => new Horde_Core_Binder_Token(),
             'Horde_Vfs' => new Horde_Core_Binder_Vfs(),
index 910d968..8a87d76 100644 (file)
@@ -82,7 +82,7 @@ class Horde_Themes
                 /* Use CSS tidy to clean up file. */
                 if ($conf['cachecssparams']['compress'] == 'php') {
                     try {
-                        $out = Horde_Text_Filter::filter($out, 'csstidy');
+                        $out = $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($out, 'csstidy');
                     } catch (Horde_Exception $e) {}
                 }
 
index 8c0ff3a..b92c753 100644 (file)
@@ -120,6 +120,7 @@ Application Framework.</description>
        <file name="SessionHandler.php" role="php" />
        <file name="Share.php" role="php" />
        <file name="Template.php" role="php" />
+       <file name="TextFilter.php" role="php" />
        <file name="Token.php" role="php" />
        <file name="Tree.php" role="php" />
        <file name="Twitter.php" role="php" />
@@ -149,6 +150,7 @@ Application Framework.</description>
        <file name="LoginTasks.php" role="php" />
        <file name="Request.php" role="php" />
        <file name="Share.php" role="php" />
+       <file name="TextFilter.php" role="php" />
        <file name="Tree.php" role="php" />
        <file name="Vfs.php" role="php" />
       </dir> <!-- /lib/Horde/Core/Factory -->
@@ -382,6 +384,7 @@ Application Framework.</description>
    <install as="Horde/Core/Binder/SessionHandler.php" name="lib/Horde/Core/Binder/SessionHandler.php" />
    <install as="Horde/Core/Binder/Share.php" name="lib/Horde/Core/Binder/Share.php" />
    <install as="Horde/Core/Binder/Template.php" name="lib/Horde/Core/Binder/Template.php" />
+   <install as="Horde/Core/Binder/TextFilter.php" name="lib/Horde/Core/Binder/TextFilter.php" />
    <install as="Horde/Core/Binder/Tree.php" name="lib/Horde/Core/Binder/Tree.php" />
    <install as="Horde/Core/Binder/Token.php" name="lib/Horde/Core/Binder/Token.php" />
    <install as="Horde/Core/Binder/Twitter.php" name="lib/Horde/Core/Binder/Twitter.php" />
@@ -407,6 +410,7 @@ Application Framework.</description>
    <install as="Horde/Core/Factory/LoginTasks.php" name="lib/Horde/Core/Factory/LoginTasks.php" />
    <install as="Horde/Core/Factory/Request.php" name="lib/Horde/Core/Factory/Request.php" />
    <install as="Horde/Core/Factory/Share.php" name="lib/Horde/Core/Factory/Share.php" />
+   <install as="Horde/Core/Factory/TextFilter.php" name="lib/Horde/Core/Factory/TextFilter.php" />
    <install as="Horde/Core/Factory/Tree.php" name="lib/Horde/Core/Factory/Tree.php" />
    <install as="Horde/Core/Factory/Vfs.php" name="lib/Horde/Core/Factory/Vfs.php" />
    <install as="Horde/Core/Log/Logger.php" name="lib/Horde/Core/Log/Logger.php" />
index ba5a1e6..6733af3 100644 (file)
@@ -234,7 +234,7 @@ class Horde_Mime_Mail
         $this->_htmlBody->setCharset($charset);
         $this->_htmlBody->setContents($body);
         if ($alternative) {
-            $this->setBody(Horde_Text_Filter::filter($body, 'Html2text', array('wrap' => false)), $charset);
+            $this->setBody(Horde_Text_Filter::filter($body, 'Html2text', array('charset' => $charset, 'wrap' => false)), $charset);
         }
     }
 
index 01060de..f323c0e 100644 (file)
@@ -850,7 +850,7 @@ function render_field($field)
     case 'mediumtext':
     case 'longblob':
     case 'longtext':
-        return "nl2br(Horde_Text::linkUrls(Horde_Text_Filter::filter(\$zitem['$n'], 'space2html', array('charset' => $GLOBALS['registry']->getCharset(), 'encode' => true)), false, 'text'))";
+        return "nl2br(Horde_Text::linkUrls(\$GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter(\$zitem['$n'], 'space2html', array('encode' => true)), false, 'text'))";
 
     case 'bool':
     case 'boolean':
index e0f7cba..44741e0 100644 (file)
@@ -46,8 +46,9 @@ class Horde_Text_Filter
     /**
      * Applies a set of patterns to a block of text.
      *
-     * @param string $text     The text to filter.
-     * @param array $patterns  The array of patterns to filter with.
+     * @param string $text    The text to filter.
+     * @param mixed $filters  The list of filters (or a single filter).
+     * @param mixed $params   The list of params to use with each filter.
      *
      * @return string  The transformed text.
      */
@@ -58,7 +59,9 @@ class Horde_Text_Filter
             $params = array($params);
         }
 
-        foreach ($filters as $num => $filter) {
+        $params = array_values($params);
+
+        foreach (array_values($filters) as $num => $filter) {
             try {
                 $filterOb = self::factory($filter, isset($params[$num]) ? $params[$num] : array());
             } catch (Horde_Text_Filter_Exception $e) {
index 18cb5aa..bb98673 100644 (file)
@@ -91,9 +91,13 @@ EOR;
     {
         $data = $this->_regexCallback($matches);
 
-        return $this->_params['encode']
-            ? "\01\01\01" . base64_encode($data) . "\01\01\01"
-           : $data;
+        if ($this->_params['encode']) {
+            $data = "\01\01\01" . base64_encode($data) . "\01\01\01";
+        }
+
+        return $matches[1] . $matches[2] . $matches[9] .
+            $data .
+            $matches[4] . $matches[8] . (isset($matches[14]) ? $matches[14] : '');
     }
 
     /**
@@ -109,10 +113,11 @@ EOR;
         $class = empty($this->_params['class'])
             ? ''
             : ' class="' . $this->_params['class'] . '"';
+        $email = ($matches[10] === '')
+            ? $matches[3] . $matches[5]
+            : $matches[10] . $matches[11];
 
-        return ($matches[10] === '')
-            ? $matches[1] . $matches[2] . '<a' . $class . ' href="mailto:' . $matches[3] . $matches[5] . '">' . $matches[3] . $matches[5] . '</a>' . $matches[4] . $matches[8]
-            : (($matches[9] == '<') ? '&lt;' : $matches[9]) . '<a' . $class . ' href="mailto:' . $matches[10] . $matches[11] . '">' . $matches[10] . $matches[11] . '</a>' . ($matches[14] ? '&gt;' : '');
+        return '<a' . $class . ' href="mailto:' . htmlspecialchars($email) . '">' . htmlspecialchars($email) . '</a>';
     }
 
     /**
index 63acd5f..b4376a1 100644 (file)
@@ -5,12 +5,12 @@
  *
  * Parameters:
  * <pre>
- * callback - (string) See Horde_Text_Filter_Linkurls::.
  * charset - (string) The charset to use for htmlspecialchars() calls.
  * class - (string) See Horde_Text_Filter_Linkurls::.
- * nofollow - (boolean) See Horde_Text_Filter_Linkurls::.
- * noprefetch - (boolean) See Horde_Text_Filter_Linkurls::.
+ * emails - (array)
+ * linkurls - (array)
  * parselevel - (integer) The parselevel of the output (see below).
+ * space2html - (array)
  * </pre>
  *
  * <pre>
@@ -53,12 +53,12 @@ class Horde_Text_Filter_Text2html extends Horde_Text_Filter_Base
      * @var array
      */
     protected $_params = array(
-        'callback' => 'Horde::externalUrl',
         'charset' => 'ISO-8859-1',
         'class' => 'fixed',
-        'nofollow' => false,
-        'noprefetch' => false,
-        'parselevel' => 0
+        'linkurls' => false,
+        'text2html' => false,
+        'parselevel' => 0,
+        'space2html' => false
     );
 
     /**
@@ -95,15 +95,29 @@ class Horde_Text_Filter_Text2html extends Horde_Text_Filter_Base
         }
 
         if ($this->_params['parselevel'] < self::NOHTML) {
-            $filters = array('linkurls' => array(
-                'callback' => $this->_params['callback'],
-                'nofollow' => $this->_params['nofollow'],
-                'noprefetch' => $this->_params['noprefetch'],
-                'encode' => true
-            ));
+            $filters = array();
+            if ($this->_params['linkurls']) {
+                reset($this->_params['linkurls']);
+                $this->_params['linkurls'][key($this->_params['linkurls'])]['encode'] = true;
+                $filters = $this->_params['linkurls'];
+            } else {
+                $filters['linkurls'] = array(
+                    'encode' => true
+                );
+            }
+
             if ($this->_params['parselevel'] < self::MICRO_LINKURL) {
-                $filters['emails'] = array('encode' => true);
+                if ($this->_params['emails']) {
+                    reset($this->_params['emails']);
+                    $this->_params['emails'][key($this->_params['emails'])]['encode'] = true;
+                    $filters += $this->_params['emails'];
+                } else {
+                    $filters['emails'] = array(
+                        'encode' => true
+                    );
+                }
             }
+
             $text = Horde_Text_Filter::filter($text, array_keys($filters), array_values($filters));
         }
 
@@ -126,7 +140,15 @@ class Horde_Text_Filter_Text2html extends Horde_Text_Filter_Base
                 $text = Horde_Text_Filter_Emails::decode($text);
             }
 
-            $text = Horde_Text_Filter::filter($text, 'space2html');
+            if ($this->_params['space2html']) {
+                $params = reset($this->_params['space2html']);
+                $driver = key($this->_params['space2html']);
+            } else {
+                $driver = 'space2html';
+                $params = array();
+            }
+
+            $text = Horde_Text_Filter::filter($text, $driver, $params);
         }
 
         /* Do the newline ---> <br /> substitution. Everybody gets this; if
index fafbb5e..9f39920 100644 (file)
@@ -22,7 +22,7 @@ Don't link http://test@www.horde.org/ test.
 Real world example: mailto:pmx-auto-approve%2b27f0e770e2d85bf9bd8fea61f9dedbff@example.com?subject=Release%20message%20from%20quarantine&body=%5b%23ptn6Pw-1%5d
 EOT;
 
-echo Horde_Text_Filter::filter($emails, 'emails', array('always_mailto' => true, 'class' => 'pagelink'));
+echo Horde_Text_Filter::filter($emails, 'emails', array('class' => 'pagelink'));
 
 ?>
 --EXPECT--
index ec8a40e..2b80efa 100644 (file)
@@ -123,9 +123,7 @@ class Horde_Block_Horde_fortune extends Horde_Block
                 . $this->_params['offend']
                 . ' ' . implode(' ', $this->_params['fortune']);
             return '<span class="fixed"><small>'
-                . nl2br(Horde_Text_Filter::filter(shell_exec($cmdLine),
-                                            array('space2html'),
-                                            array(array('encode' => true))))
+                . nl2br($GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter(shell_exec($cmdLine), array('space2html'), array(array('encode' => true))))
                 . '</small></span>';
         } else {
             return '';
index d4512c6..7524d1d 100644 (file)
@@ -164,7 +164,7 @@ EOT;
            . Horde::img('loading.gif', '', array('id' => $instance . '_loading', 'style' => 'display:none;'));
         $html .= '<div id="currentStatus" class="" style="margin: 10px;"><strong>' . _("Latest") . '</strong> ' . $latestStatus . ' - <span class="fbstreaminfo">' . Horde_Date_Utils::relativeDateTime(strtotime($this->_profile->status->created_at), $GLOBALS['prefs']->getValue('date_format'), ($GLOBALS['prefs']->getValue('twentyFour') ? "%H:%M" : "%I:%M %P")) . '</span></div></div>';
         $html .= '<div style="height:' . (empty($this->_params['height']) ? 350 : $this->_params['height']) . 'px;overflow-y:auto;" id="twitter_body' . $instance . '">';
-        $filter = Horde_Text_Filter::factory('Text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO));
+        $filter = $GLOBALS['injector']->getInstance('Horde_Text_Filter')->getFilter('Text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO));
         $html .= '</div>';
         $html .= '<div class="control fbgetmore"><a href="#" onclick="Horde.twitter.getOlderEntries();return false;">' . _("Get More") . '</a></div>';
         $html .= '</div>';
index e81fece..49cba81 100644 (file)
@@ -53,7 +53,7 @@ case 'getPage':
         } elseif ($since = Horde_Util::getPost('since_id')) {
             $params['since_id'] = $since;
         }
-        
+
         $stream = Horde_Serialize::unserialize($twitter->statuses->homeTimeline($params), Horde_Serialize::JSON);
     } catch (Horde_Service_Twitter_Exception $e) {
         echo sprintf(_("Unable to contact Twitter. Please try again later. Error returned: %s"), $e->getMessage());
@@ -65,8 +65,10 @@ case 'getPage':
          $view = new Horde_View(array('templatePath' => HORDE_TEMPLATES . '/block'));
          $view->addHelper('Tag');
 
+         $filter = $injector->getInstance('Horde_Text_Filter');
+
          /* links */
-        $body = Horde_Text_Filter::filter($tweet->text, 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO_LINKURL));
+        $body = $filter->filter($tweet->text, 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO_LINKURL));
         $view->body = preg_replace("/[@]+([A-Za-z0-9-_]+)/", "<a href=\"http://twitter.com/\\1\" target=\"_blank\">\\0</a>", $body);
 
         /* If this is a retweet, use the original author's profile info */
@@ -82,7 +84,7 @@ case 'getPage':
         $view->authorName = htmlspecialchars($tweetObj->user->screen_name, ENT_COMPAT, $GLOBALS['registry']->getCharset());
         $view->authorFullname = htmlspecialchars($tweetObj->user->name, ENT_COMPAT, $GLOBALS['registry']->getCharset());
         $view->createdAt = $tweetObj->created_at;
-        $view->clientText = Horde_Text_Filter::filter($tweet->source, 'xss', array());
+        $view->clientText = $filter->filter($tweet->source, 'xss');
         $view->tweet = $tweet;
         $oldest = $tweet->id;
         $html .= $view->render('twitter_tweet');
index e0eaf4d..eb3d5d1 100644 (file)
@@ -41,7 +41,7 @@ function openHtmlHelper(type, target)
     if (type == 'emoticons') {
         row = document.createElement('TR');
         cell = document.createElement('TD');
-        <?php $filter = Horde_Text_Filter::factory('emoticons'); $icons = array_flip($filter->getIcons()); foreach ($icons as $icon => $string): ?>
+        <?php $filter = $GLOBALS['injector']->getInstance('Horde_Text_Filter')->getFilter('emoticons'); $icons = array_flip($filter->getIcons()); foreach ($icons as $icon => $string): ?>
         link = document.createElement('A');
         link.href = '#';
         link.onclick = function() {
index a3edc5d..31e7231 100644 (file)
@@ -1023,7 +1023,7 @@ class IMP_Compose
 
         if (!empty($options['html'])) {
             $body_html = $body;
-            $body = Horde_Text_Filter::filter($body, 'Html2text', array('wrap' => false, 'charset' => $charset));
+            $body = $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($body, 'Html2text', array('wrap' => false, 'charset' => $charset));
         }
 
         /* Get trailer message (if any). */
@@ -1039,7 +1039,7 @@ class IMP_Compose
             }
 
             if (!empty($trailer_file)) {
-                $trailer = Horde_Text_Filter::filter("\n" . file_get_contents($trailer_file), 'environment');
+                $trailer = $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter("\n" . file_get_contents($trailer_file), 'environment');
                 try {
                     $trailer = Horde::callHook('trailer', array($trailer), 'imp');
                 } catch (Horde_Exception_HookNotSet $e) {}
@@ -1072,7 +1072,7 @@ class IMP_Compose
             $htmlBody->setCharset($charset);
             $htmlBody->setDisposition('inline');
             $htmlBody->setDescription(Horde_String::convertCharset(_("HTML Version"), $nls_charset, $charset));
-            $htmlBody->setContents(Horde_Text_Filter::filter($body_html, 'cleanhtml', array('charset' => $charset)));
+            $htmlBody->setContents($GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($body_html, 'cleanhtml', array('charset' => $charset)));
 
             $textBody->setDescription(Horde_String::convertCharset(_("Plaintext Version"), $nls_charset, $charset));
 
@@ -2462,9 +2462,9 @@ class IMP_Compose
         }
 
         if ($mode == 'html') {
-            $msg = Horde_Text_Filter::filter($msg, array('cleanhtml', 'xss'), array(array('body_only' => true, 'charset' => $charset), array('body_only' => true, 'strip_styles' => true, 'strip_style_attributes' => false)));
+            $msg = $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($msg, array('cleanhtml', 'xss'), array(array('body_only' => true), array('body_only' => true, 'strip_styles' => true, 'strip_style_attributes' => false)));
         } elseif ($type == 'text/html') {
-            $msg = Horde_Text_Filter::filter($msg, 'html2text', array('charset' => $charset));
+            $msg = $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($msg, 'html2text');
             $type = 'text/plain';
         }
 
@@ -2622,7 +2622,7 @@ class IMP_Compose
      */
     static public function text2html($msg)
     {
-        return Horde_Text_Filter::filter($msg, 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO_LINKURL, 'class' => null, 'callback' => null));
+        return $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($msg, 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO_LINKURL, 'callback' => null));
     }
 
     /**
index b7ded3d..0cb010c 100644 (file)
@@ -527,7 +527,7 @@ class IMP_Contents
         $ptext = $pmime->getContents();
         $ptext = Horde_String::convertCharset($ptext, $pmime->getCharset());
         if ($pmime->getType() == 'text/html') {
-            $ptext = Horde_Text_Filter::filter($ptext, 'Html2text', array('charset' => $GLOBALS['registry']->getCharset()));
+            $ptext = $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($ptext, 'Html2text');
         }
 
         $this->_build = $oldbuild;
index ee7b9e3..7e15775 100644 (file)
@@ -228,7 +228,7 @@ class IMP
                     : $mbox['abbrev'];
 
                 $mbox_list[] = array(
-                    'l' => Horde_Text_Filter::filter($label, 'space2html', array('charset' => $GLOBALS['registry']->getCharset(), 'encode' => true)),
+                    'l' => $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($label, 'space2html', array('encode' => true)),
                     'sel' => (!empty($options['selected']) && ($mbox['val'] === $options['selected'])),
                     'v' => htmlspecialchars($mbox['val'])
                 );
@@ -245,7 +245,7 @@ class IMP
                 $vfolder_sel = $imp_search->searchMboxID();
                 foreach ($vfolders as $id => $val) {
                     $vfolder_list[] = array(
-                        'l' => Horde_Text_Filter::filter($val, 'space2html', array('charset' => $GLOBALS['registry']->getCharset(), 'encode' => true)),
+                        'l' => $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($val, 'space2html', array('encode' => true)),
                         'sel' => ($vfolder_sel == $id),
                         'v' => htmlspecialchars($imp_search->createSearchID($id))
                     );
@@ -264,7 +264,7 @@ class IMP
                     $tasklist_list = array();
                     foreach ($tasklists as $id => $tasklist) {
                         $tasklist_list[] = array(
-                            'l' => Horde_Text_Filter::filter($tasklist->get('name'), 'space2html', array('charset' => $GLOBALS['registry']->getCharset(), 'encode' => true)),
+                            'l' => $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($tasklist->get('name'), 'space2html', array('encode' => true)),
                             'v' => '\0tasklist_' . $id
                         );
                     }
@@ -283,7 +283,7 @@ class IMP
                     $notepad_list[] = array();
                     foreach ($notepads as $id => $notepad) {
                         $notepad_list[] = array(
-                            'l' => Horde_Text_Filter::filter($notepad->get('name'), 'space2html', array('charset' => $GLOBALS['registry']->getCharset(), 'encode' => true)),
+                            'l' => $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($notepad->get('name'), 'space2html', array('encode' => true)),
                             'v' => '\0notepad_' . $id
                         );
                     }
@@ -522,7 +522,10 @@ class IMP
     static public function filterText($text)
     {
         if ($GLOBALS['prefs']->getValue('filtering') && strlen($text)) {
-            return Horde_Text_Filter::filter($text, 'words', array('words_file' => $GLOBALS['conf']['msgsettings']['filtering']['words'], 'replacement' => $GLOBALS['conf']['msgsettings']['filtering']['replacement']));
+            return $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($text, 'words', array(
+                'replacement' => $GLOBALS['conf']['msgsettings']['filtering']['replacement'],
+                'words_file' => $GLOBALS['conf']['msgsettings']['filtering']['words']
+            ));
         }
 
         return $text;
index 3aae5d3..ee0cae7 100644 (file)
@@ -193,7 +193,7 @@ class IMP_Horde_Mime_Viewer_Html extends Horde_Mime_Viewer_Html
          * text. */
         if (($_SESSION['imp']['view'] == 'mimp') ||
             (!$inline && Horde_Util::getFormData('convert_text'))) {
-            $data = Horde_Text_Filter::filter($data, 'Html2text', array('charset' => $GLOBALS['registry']->getCharset(), 'wrap' => false));
+            $data = $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($data, 'Html2text', array('wrap' => false));
 
             // Filter bad language.
             return array(
@@ -257,7 +257,7 @@ class IMP_Horde_Mime_Viewer_Html extends Horde_Mime_Viewer_Html
         }
 
         if ($GLOBALS['prefs']->getValue('emoticons')) {
-            $data = Horde_Text_Filter::filter($data, array('Horde_Core_Text_Filter_Emoticons'), array(array('entities' => true)));
+            $data = $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($data, array('emoticons'), array(array('entities' => true)));
         }
 
         return array(
index 20c47b5..74e3d65 100644 (file)
@@ -384,7 +384,7 @@ class IMP_Horde_Mime_Viewer_Pgp extends Horde_Mime_Viewer_Driver
                 'icon' => $icon,
                 'success' => $success,
                 'text' => array(
-                    Horde_Text_Filter::filter($sig_text, 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::NOHTML))
+                    $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($sig_text, 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::NOHTML))
                 )
             );
 
index 994c3cf..b8d1d05 100644 (file)
@@ -143,11 +143,11 @@ class IMP_Horde_Mime_Viewer_Plain extends Horde_Mime_Viewer_Plain
         }
 
         if ($prefs->getValue('emoticons')) {
-            $filters['Horde_Core_Text_Filter_Emoticons'] = array('entities' => true);
+            $filters['emoticons'] = array('entities' => true);
         }
 
         // Run filters.
-        $text = Horde_Text_Filter::filter($text, array_keys($filters), array_values($filters));
+        $text = $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($text, array_keys($filters), array_values($filters));
 
         // Wordwrap.
         $text = str_replace(array('  ', "\n "), array(' &nbsp;', "\n&nbsp;"), $text);
@@ -347,14 +347,13 @@ class IMP_Horde_Mime_Viewer_Plain extends Horde_Mime_Viewer_Plain
         // Escape text
         $filters = array(
             'text2html' => array(
-                'charset' => $GLOBALS['registry']->getCharset(),
                 'parselevel' => Horde_Text_Filter_Text2html::MICRO
             ),
             'tabs2spaces' => array(),
         );
 
         return '<div class="fixed">' .
-            Horde_Text_Filter::filter(Horde_String::convertCharset(fread($stream, 1024), $this->_mimepart->getCharset()), array_keys($filters), array_values($filters)) .
+            $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter(Horde_String::convertCharset(fread($stream, 1024), $this->_mimepart->getCharset()), array_keys($filters), array_values($filters)) .
             ' [...]</div>';
     }
 
index a3f11a7..982f6ad 100644 (file)
@@ -1606,7 +1606,7 @@ class IMP_Prefs_Ui
 
         if ($ui->vars->last_type != $type) {
             $content = ($type == 'plain')
-                ? Horde_Text_Filter::filter($content, 'Html2text', array('charset' => $GLOBALS['registry']->getCharset()))
+                ? $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($content, 'Html2text')
                 : nl2br(htmlspecialchars(htmlspecialchars($content)));
         }
 
index 4088840..26f8e84 100644 (file)
@@ -358,7 +358,7 @@ class IMP_Ui_Compose
                 }
             }
 
-            $data = Horde_Text_Filter::filter($data, 'Html2text', array('charset' => $GLOBALS['registry']->getCharset(), 'wrap' => false));
+            $data = $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($data, 'Html2text', array('wrap' => false));
             $sig = $txt_sig;
             break;
         }
index 5e9df72..2401e8f 100644 (file)
@@ -252,7 +252,7 @@ class IMP_Ui_Mailbox
         $new_subject = $subject = IMP::filterText(preg_replace("/\s+/", ' ', $subject));
 
         if ($htmlspaces) {
-            $new_subject = Horde_Text_Filter::filter($subject, 'space2html', array('charset' => $GLOBALS['registry']->getCharset(), 'encode' => true));
+            $new_subject = $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($subject, 'space2html', array('encode' => true));
             if (empty($new_subject)) {
                 $new_subject = htmlspecialchars($subject);
             }
index a77f713..1f882b0 100644 (file)
@@ -246,9 +246,7 @@ class IMP_Ui_Message
                 }
                 break;
             } elseif (empty($data['email'])) {
-                if ($url = Horde_Text_Filter::filter($match, 'linkurls', array(
-                    'callback' => 'Horde::externalUrl'
-                ))) {
+                if ($url = $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($match, 'linkurls')) {
                     if (!empty($opts['raw'])) {
                         return $match;
                     }
@@ -634,7 +632,7 @@ class IMP_Ui_Message
      */
     public function getDisplaySubject($subject)
     {
-        return Horde_Text_Filter::filter(preg_replace("/\b\s+\b/", ' ', IMP::filterText($subject)), 'text2html', array(
+        return $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter(preg_replace("/\b\s+\b/", ' ', IMP::filterText($subject)), 'text2html', array(
             'parselevel' => Horde_Text_Filter_Text2html::MICRO
         ));
     }
index e40f564..7cb954d 100644 (file)
@@ -751,7 +751,7 @@ while (list(,$ob) = each($mbox_info['overview'])) {
             }
 
             if (!$preview_tooltip) {
-                $ptext = Horde_Text_Filter::filter($ptext, 'text2html', array(
+                $ptext = $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($ptext, 'text2html', array(
                     'parselevel' => Horde_Text_Filter_Text2html::NOHTML
                 ));
             }
index fe2fc8f..cf9b79b 100644 (file)
@@ -258,7 +258,7 @@ if ($prefs->getValue('mimp_preview_msg') &&
     $t->set('fullmsg_link', $self_link->copy()->add('fullmsg', 1));
 }
 
-$t->set('msg', nl2br(Horde_Text_Filter::filter($msg_text, 'space2html', array('charset' => $registry->getCharset(), 'encode' => true))));
+$t->set('msg', nl2br($GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($msg_text, 'space2html', array('encode' => true))));
 
 $compose_params = array(
     'identity' => $identity,
index bf5b7b4..4b7700f 100644 (file)
@@ -265,7 +265,7 @@ case 'print_attach':
                     }
                 }
 
-                if ($style = Horde_Text_Filter::filter(Horde_Themes::loadCssFiles(Horde_Themes::getStylesheets()), 'csstidy', array('ob' => true, 'preserve_css' => false))->filterBySelector($selectors)) {
+                if ($style = $injector->getInstance('Horde_Text_Filter')->filter(Horde_Themes::loadCssFiles(Horde_Themes::getStylesheets()), 'csstidy', array('ob' => true, 'preserve_css' => false))->filterBySelector($selectors)) {
                     $elt->setAttribute('style', ($elt->hasAttribute('style') ? rtrim($elt->getAttribute('style'), ' ;') . ';' : '') . $style);
                 }
             }
index cf7258b..3a77582 100644 (file)
@@ -139,7 +139,7 @@ class Ingo
                     $label = $mbox['abbrev'];
                     $text .= sprintf('<option%s value="%s"%s>%s</option>%s',
                                      $disabled, $val, $sel,
-                                     Horde_Text_Filter::filter($label, 'space2html', array('charset' => $GLOBALS['registry']->getCharset(), 'encode' => true)), "\n");
+                                     $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($label, 'space2html', array('encode' => true)), "\n");
                 }
 
                 return $text . '</select>';
index 68da83a..5f8cb8e 100644 (file)
@@ -82,7 +82,7 @@ foreach ($stories as &$story) {
     $story['story_permalink'] = (isset($story['story_permalink']) ? htmlspecialchars($story['story_permalink']) : '');
     $story['story_published'] = htmlspecialchars(date('r', $story['story_published']));
     if (!empty($story['story_body_type']) && $story['story_body_type'] == 'text') {
-        $story['story_body'] = Horde_Text_Filter::filter($story['story_body'], 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO, 'class' => null));
+        $story['story_body'] = $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($story['story_body'], 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO));
     }
 }
 $template->set('stories', $stories);
index 3c17421..a61f2c6 100644 (file)
@@ -47,7 +47,7 @@ class Jonah_Api extends Horde_Registry_Api
 
         foreach (array_keys($stories) as $s) {
             if (empty($stories[$s]['story_body_type']) || $stories[$s]['story_body_type'] == 'text') {
-                $stories[$s]['story_body_html'] = Horde_Text_Filter::filter($stories[$s]['story_body'], 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO, 'class' => null));
+                $stories[$s]['story_body_html'] = $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($stories[$s]['story_body'], 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO));
             } else {
                 $stories[$s]['story_body_html'] = $stories[$s]['story_body'];
             }
@@ -74,7 +74,7 @@ class Jonah_Api extends Horde_Registry_Api
             return false;
         }
         if (empty($story['story_body_type']) || $story['story_body_type'] == 'text') {
-            $story['story_body_html'] = Horde_Text_Filter::filter($story['story_body'], 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO, 'class' => null));
+            $story['story_body_html'] = $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($story['story_body'], 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO));
         } else {
             $story['story_body_html'] = $story['story_body'];
         }
@@ -184,7 +184,7 @@ class Jonah_Api extends Horde_Registry_Api
             $comments = $GLOBALS['conf']['comments']['allow'] && $registry->hasMethod('forums/numMessages');
             foreach ($results as $story) {
                 if (empty($story['story_body_type']) || $story['story_body_type'] == 'text') {
-                    $story['story_body_html'] = Horde_Text_Filter::filter($story['story_body'], 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO, 'class' => null));
+                    $story['story_body_html'] = $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($story['story_body'], 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO));
                 } else {
                     $story['story_body_html'] = $story['story_body'];
                 }
index 4781c5b..2425710 100644 (file)
@@ -78,7 +78,7 @@ class Horde_Block_Jonah_latest extends Horde_Block {
         }
 
         if (empty($story['story_body_type']) || $story['story_body_type'] == 'text') {
-            $story['story_body'] = Horde_Text_Filter::filter($story['story_body'], 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO, 'class' => null));
+            $story['story_body'] = $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($story['story_body'], 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO));
         }
 
         return '<p class="storySubtitle">' . htmlspecialchars($story['story_desc']) .
index a3ea14a..9c3d66f 100644 (file)
@@ -78,7 +78,7 @@ class Horde_Block_Jonah_story extends Horde_Block {
         }
 
         if (empty($story['story_body_type']) || $story['story_body_type'] == 'text') {
-            $story['story_body'] = Horde_Text_Filter::filter($story['story_body'], 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO, 'class' => null));
+            $story['story_body'] = $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($story['story_body'], 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO));
         }
 
         $tag_html = array();
index 4a5004c..c50986e 100644 (file)
@@ -474,10 +474,10 @@ class Jonah_Driver
         case 'richtext':
             /* Get a plain text version of a richtext story. */
             $body_html = $story['story_body'];
-            $body_text = Horde_Text_Filter::filter($body_html, 'html2text');
+            $body_text = $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($body_html, 'html2text');
 
             /* Add description. */
-            $body_html = '<p>' . Horde_Text_Filter::filter($story['story_desc'], 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO, 'charset' => $GLOBALS['registry']->getCharset(), 'class' => null, 'callback' => null)) . "</p>\n" . $body_html;
+            $body_html = '<p>' . $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($story['story_desc'], 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO, 'callback' => null)) . "</p>\n" . $body_html;
             $body_text = Horde_String::wrap('  ' . $story['story_desc'], 70) . "\n\n" . $body_text;
 
             /* Add the text version of the story to the base message. */
index 12bf8fb..c18fb81 100644 (file)
@@ -627,10 +627,10 @@ class Jonah_News
         case 'richtext':
             /* Get a plain text version of a richtext story. */
             $body_html = $story['story_body'];
-            $body_text = Horde_Text_Filter::filter($body_html, 'html2text');
+            $body_text = $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($body_html, 'html2text');
 
             /* Add description. */
-            $body_html = '<p>' . Horde_Text_Filter::filter($story['story_desc'], 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO, 'charset' => $GLOBALS['registry']->getCharset(), 'class' => null, 'callback' => null)) . "</p>\n" . $body_html;
+            $body_html = '<p>' . $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($story['story_desc'], 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO, 'callback' => null)) . "</p>\n" . $body_html;
             $body_text = Horde_String::wrap('  ' . $story['story_desc'], 70) . "\n\n" . $body_text;
 
             /* Add the text version of the story to the base message. */
@@ -763,7 +763,7 @@ class Jonah_News
                 $items[$key]['story_body'] = isset($story['body']) ? Horde_String::convertCharset($story['body'], 'utf-8') : null;
                 $items[$key]['story_body_type'] = isset($story['body_type']) ? Horde_String::convertCharset($story['body_type'], 'utf-8') : 'text';
                 if ($items[$key]['story_body_type'] == 'html') {
-                    $items[$key]['story_body'] = Horde_Text_Filter::filter($items[$key]['story_body'], 'xss');
+                    $items[$key]['story_body'] = $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($items[$key]['story_body'], 'xss');
                 }
 
                 if (isset($story['pubdate']) && $pubdate_dt = strtotime($story['pubdate'])) {
index d29a80d..62baf08 100644 (file)
@@ -43,7 +43,7 @@ if (is_a($story, 'PEAR_Error')) {
 
 // Convert the body from HTML to text if necessary.
 if (!empty($story['story_body_type']) && $story['story_body_type'] == 'richtext') {
-    $story['story_body'] = Horde_Text_Filter::filter($story['story_body'], 'html2text');
+    $story['story_body'] = $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($story['story_body'], 'html2text');
 }
 
 // Set up the PDF object.
index 176926b..62e2061 100644 (file)
@@ -59,7 +59,7 @@ foreach ($story['story_tags'] as $id => $tag) {
 $story['story_title'] = htmlspecialchars($story['story_title']);
 $story['story_desc'] = htmlspecialchars($story['story_desc']);
 if (!empty($story['story_body_type']) && $story['story_body_type'] == 'text') {
-    $story['story_body'] = Horde_Text_Filter::filter($story['story_body'], 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO, 'class' => null));
+    $story['story_body'] = $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($story['story_body'], 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO));
 }
 if (!empty($story['story_url'])) {
     $story['story_body'] .= "\n<p>" . Horde::link(Horde::externalUrl($story['story_url'])) . htmlspecialchars($story['story_url']) . '</a></p>';
index 12fea80..9f0c951 100644 (file)
@@ -22,7 +22,7 @@
     <?php if (strlen($this->event->description)): ?>
     <tr>
       <td style="font-weight:bold;vertical-align:top"><?php echo _("Description:") ?></td>
-         <td><?php echo Horde_Text_Filter::filter($this->event->description, 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO, 'callback' => null, 'class' => null, 'charset' => $GLOBALS['registry']->getCharset())) ?></td>
+         <td><?php echo $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($this->event->description, 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO, 'callback' => null)) ?></td>
     </tr>
     <?php endif; ?>
     <?php if ($this->attendees): ?>
index 0ed31b6..97d4ffb 100644 (file)
@@ -4,7 +4,7 @@
 <!-- location -->
 <tr>
  <td class="rightAlign"><strong><?php echo _("Location") ?>&nbsp;&nbsp;</strong></td>
- <td><?php echo empty($location) ? '&nbsp;' : Horde_Text_Filter::filter($location, 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO, 'class' => 'text')) ?> </td>
+ <td><?php echo empty($location) ? '&nbsp;' : $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($location, 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO, 'class' => 'text')) ?> </td>
 </tr>
 <?php endif; ?>
 
@@ -12,7 +12,7 @@
 <!-- url -->
 <tr>
  <td class="rightAlign"><strong><?php echo _("URL") ?>&nbsp;&nbsp;</strong></td>
- <td><?php echo Horde_Text_Filter::filter($eventurl, 'linkurls') ?></td>
+ <td><?php echo $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($eventurl, 'linkurls') ?></td>
 </tr>
 <?php endif; ?>
 
@@ -153,7 +153,7 @@ if ($this->event->initialized && $this->event->alarm > 0):
  <td colspan="2" class="control"><strong><?php echo _("Description") ?></strong></td>
 </tr>
 <tr>
- <td colspan="2" class="description"><?php echo Horde_Text_Filter::filter($description, 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO, 'class' => 'text')) ?></td>
+ <td colspan="2" class="description"><?php echo $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($description, 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO, 'class' => 'text')) ?></td>
 </tr>
 <?php endif; ?>
 
index 1aee6cf..bc39e2e 100644 (file)
@@ -170,7 +170,7 @@ class Luxor_Lang_Generic extends Luxor_Lang
         global $index, $sourceid;
 
         // Make sure spacing is correct.
-        $code = Horde_Text_Filter::filter($code, 'space2html', array('charset' => $GLOBALS['registry']->getCharset(), 'encode' => true, 'encode_all' => true));
+        $code = $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($code, 'space2html', array('encode' => true, 'encode_all' => true));
 
         // Split all the symbols.
         preg_match_all('/(^|[^\w\#&])([\w~][\w]*)\b/', $code, $match);
index b8667b0..7552057 100644 (file)
@@ -193,7 +193,7 @@ class Luxor
             file_exists($filename = $files->toReal($path . '/README.txt'))) {
             $contents = file_get_contents($filename);
 
-            return $table_head . Horde_Text_Filter::filter($contents, 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO)) . $table_foot;
+            return $table_head . $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($contents, 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO)) . $table_foot;
         } elseif ($filename = file_exists($files->toReal($path . '/README.html'))) {
             global $mime_drivers, $mime_drivers_map;
             $result = Horde::loadConfiguration('mime_drivers.php', array('mime_drivers', 'mime_drivers_map'), 'horde');
@@ -360,7 +360,7 @@ class Luxor
         $res = '';
         foreach ($lines as $line) {
             $res .= !empty($res) ? "\n" : '';
-            $res .= $pre . Horde_Text_Filter::filter($line, 'space2html', array('charset' => $GLOBALS['registry']->getCharset(), 'encode' => true, 'encode_all' => true)) . $post;
+            $res .= $pre . $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($line, 'space2html', array('encode' => true, 'encode_all' => true)) . $post;
         }
         return $res;
     }
index 1ccee20..1a7d693 100644 (file)
@@ -11,7 +11,7 @@ class Horde_Block_Mnemo_note extends Horde_Block
 {
     protected $_app = 'mnemo';
     private $_notename = '';
-    
+
     protected function _params()
     {
         global $prefs;
@@ -40,7 +40,7 @@ class Horde_Block_Mnemo_note extends Horde_Block
     {
         $memo = $this->_getNote();
         $html = '<div class="noteBody">';
-        $body = Horde_Text_Filter::filter($memo['body'], 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO, 'class' => null));
+        $body = $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($memo['body'], 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO));
         try {
             $body = Horde::callHook('format_description', array($body), 'mnemo', $body);
         } catch (Horde_Exception_HookNotSet $e) {}
index bac661f..3bb3ffe 100644 (file)
@@ -56,7 +56,7 @@ if (!$print_view) {
    </div>
 <?php else: ?>
    <div class="noteBody">
-    <?php $body = Horde_Text_Filter::filter($memo['body'], 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO, 'class' => null)); try { $body = Horde::callHook('format_description', array($body), 'mnemo', $body); } catch (Horde_Exception_HookNotSet $e) {} echo $body; ?>
+    <?php $body = $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($memo['body'], 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO)); try { $body = Horde::callHook('format_description', array($body), 'mnemo', $body); } catch (Horde_Exception_HookNotSet $e) {} echo $body; ?>
    </div>
 <?php endif; ?>
   </td>
index 598d3b7..b87f316 100644 (file)
@@ -423,7 +423,7 @@ class Nag_Task {
      */
     function getFormattedDescription()
     {
-        $desc = Horde_Text_Filter::filter($this->desc, 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO));
+        $desc = $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($this->desc, 'text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO));
         try {
             return Horde::callHook('format_description', array($desc), 'nag');
         } catch (Horde_Exception_HookNotSet $e) {
index d60f5b6..d764a0d 100755 (executable)
@@ -140,9 +140,9 @@ class Horde_Form_Renderer_Comment extends Horde_Form_Renderer {
             $flowed = new Horde_Text_Flowed($comment);
             $flowed->setDelSp(true);
             $comment = $flowed->toFlowed(false);
-            $comment = Horde_Text_Filter::filter(
+            $comment = $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter(
                 $comment, array('text2html', 'simplemarkup', 'highlightquotes'),
-                array(array('parselevel' => Horde_Text_Filter_Text2html::MICRO, 'class' => null),
+                array(array('parselevel' => Horde_Text_Filter_Text2html::MICRO),
                       array(), array()));
             if ($prefs->getValue('autolink_tickets') &&
                 $conf['prefs']['autolink_terms']) {