CoreFiles by mySites.guru
rtf.php42 lines, 1,061 bytes, from Joomla_3.0.3-Stable-Full_Package.zip
Raw History Compare with 3.0.2
md5
42fac15b4ca801d7eb880629241d65fd
sha1
04abcc28a88706cf9e2036ac8099ce19026fc259
sha256
36a3c5d0e9b617610eb50bc23fdb303d0df718951a648285249fc45b943898c8
<?php
/**
 * @package     Joomla.Administrator
 * @subpackage  com_finder
 *
 * @copyright   Copyright (C) 2005 - 2013 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.9 to 3.1.1. See them all, or every version of this file.