CoreFiles by mySites.guru
rtf.php42 lines, 1,061 bytes, from Joomla_2.5.0-Stable-Full_Package.zip
Raw History Compare with 1.7.5
md5
4a5d6b459c08655baab9c752a0ca1f68
sha1
1358b85d2bd9e53c5b69b12ec2dd4e2dbb6768a1
sha256
a23e7519284bd6e384d78f8b2c6f7a7e89f27225ca098ddda796f384028c8412
<?php
/**
 * @package     Joomla.Administrator
 * @subpackage  com_finder
 *
 * @copyright   Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE
 */

defined('_JEXEC') or die;

/**
 * RTF Parser class for the Finder indexer package.
 *
 * @package     Joomla.Administrator
 * @subpackage  com_finder
 * @since       2.5
 */
class FinderIndexerParserRtf extends FinderIndexerParser
{
	/**
	 * Method to process RTF input and extract the plain text.
	 *
	 * @param   string  $input  The input to process.
	 *
	 * @return  string  The plain text input.
	 *
	 * @since   2.5
	 */
	protected function process($input)
	{
		// Remove embedded pictures.
		$input = preg_replace('#{\\\pict[^}]*}#mis', '', $input);

		// Remove control characters.
		$input = str_replace(array('{', '}', "\\\n"), array(' ', ' ', "\n"), $input);
		$input = preg_replace('#\\\([^;]+?);#mis', ' ', $input);
		$input = preg_replace('#\\\[\'a-zA-Z0-9]+#mis', ' ', $input);

		return $input;
	}
}

The same content is in 12 releases, Joomla 2.5.0 to 3.0.2. See them all, or every version of this file.