CoreFiles by mySites.guru
rtf.php42 lines, 1,073 bytes, from Joomla_3.7.3-beta1-Beta-Full_Package.zip
Raw History Compare with 3.7.0-beta4
md5
a34531540ecc0f3be1878b5b39202543
sha1
c35cb54ba2b5d70f01759d0d626dc4fb16315aa9
sha256
f09a329658795b5ac246369d600139797e5fe355392da2f9e3d331e3c3ce1737
<?php
/**
 * @package     Joomla.Administrator
 * @subpackage  com_finder
 *
 * @copyright   Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

JLoader::register('FinderIndexerParser', dirname(__DIR__) . '/parser.php');

/**
 * RTF Parser class for the Finder indexer package.
 *
 * @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 21 releases, Joomla 3.7.3-beta1 to 4.0.0-alpha2. See them all, or every version of this file.