CoreFiles by mySites.guru
rtf.php42 lines, 1,069 bytes, from Joomla_3.9.1-Stable-Full_Package.zip
Raw History Compare with 3.9.0
md5
86e777dfd8d749a4871eb8a4132bb7ef
sha1
2fa99f216833efe293c8939ab878ae5259c7a753
sha256
8e9322f834865fb21b9d488faefe630093ddc2f13f733f3ac269d6b6b9c8fec3
<?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[^}]*}#mi', '', $input);

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

		return $input;
	}
}

The same content is in 13 releases, Joomla 3.8.12-rc to 3.9.1. See them all, or every version of this file.