CoreFiles by mySites.guru
rtf.php42 lines, 1,073 bytes, from Joomla_4.0.0-alpha6-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha5
md5
e9fe5e2b25a81608898442a1b2d11c37
sha1
2690aa1b28aa03e699960987db83ad59c3ed1dd8
sha256
58d8da32637f5c9cc8faa6eaa3e2f8333f4e841b22521bab58b5bcbb9c6d3dc7
<?php
/**
 * @package     Joomla.Administrator
 * @subpackage  com_finder
 *
 * @copyright   Copyright (C) 2005 - 2018 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 19 releases, Joomla 3.8.4-rc to 4.0.0-alpha6. See them all, or every version of this file.