Source for file rtf.php

Documentation is available at rtf.php

  1. <?php
  2. /**
  3.  * @package     Joomla.Administrator
  4.  * @subpackage  com_finder
  5.  *
  6.  * @copyright   Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
  7.  * @license     GNU General Public License version 2 or later; see LICENSE
  8.  */
  9.  
  10. defined('_JEXEC'or die;
  11.  
  12. JLoader::register('FinderIndexerParser'dirname(__DIR__'/parser.php');
  13.  
  14. /**
  15.  * RTF Parser class for the Finder indexer package.
  16.  *
  17.  * @package     Joomla.Administrator
  18.  * @subpackage  com_finder
  19.  * @since       2.5
  20.  */
  21. {
  22.     /**
  23.      * Method to process RTF input and extract the plain text.
  24.      *
  25.      * @param   string  $input  The input to process.
  26.      *
  27.      * @return  string  The plain text input.
  28.      *
  29.      * @since   2.5
  30.      */
  31.     protected function process($input)
  32.     {
  33.         // Remove embedded pictures.
  34.         $input preg_replace('#{\\\pict[^}]*}#mis'''$input);
  35.  
  36.         // Remove control characters.
  37.         $input str_replace(array('{''}'"\\\n")array(' '' '"\n")$input);
  38.         $input preg_replace('#\\\([^;]+?);#mis'' '$input);
  39.         $input preg_replace('#\\\[\'a-zA-Z0-9]+#mis'' '$input);
  40.  
  41.         return $input;
  42.     }
  43. }

Documentation generated on Tue, 19 Nov 2013 15:12:31 +0100 by phpDocumentor 1.4.3