CoreFiles by mySites.guru
StripWhitespace.php54 lines, 1,202 bytes, from Joomla_1.5.3-Stable-Full_Package.zip
Raw History Compare with 1.5.2
md5
e9d237c0b843966646dcca9705ce4dab
sha1
b3f355499e1bb3850a47ea1a2f1ccd43545cc3b1
sha256
34eb07e1fd525df6e3463f75f95cf499ca29bbec0fb1994d42f82781b67b94b6
<?PHP
/**
 * patTemplate StripWhitespace output filter
 *
 * $Id: StripWhitespace.php 8287 2007-08-01 08:38:59Z eddieajau $
 *
 * Will remove all whitespace and replace it with a single space.
 *
 * @package		patTemplate
 * @subpackage	Filters
 * @author		Stephan Schmidt <[email protected]>
 */

// Check to ensure this file is within the rest of the framework
defined('JPATH_BASE') or die();

/**
 * patTemplate StripWhitespace output filter
 *
 * $Id: StripWhitespace.php 8287 2007-08-01 08:38:59Z eddieajau $
 *
 * Will remove all whitespace and replace it with a single space.
 *
 * @package		patTemplate
 * @subpackage	Filters
 * @author		Stephan Schmidt <[email protected]>
 */
class patTemplate_OutputFilter_StripWhitespace extends patTemplate_OutputFilter
{
	/**
	* filter name
	*
	* @access	protected
	* @abstract
	* @var	string
	*/
	var	$_name	=	'StripWhitespace';

	/**
	* remove all whitespace from the output
	*
	* @access	public
	* @param	string		data
	* @return	string		data without whitespace
	*/
	function apply( $data )
	{
		$data = str_replace( "\n", ' ', $data );
		$data = preg_replace( '/\s\s+/', ' ', $data );

		return $data;
	}
}
?>

The same content is in 4 releases, Joomla 1.5.0 to 1.5.3. See them all, or every version of this file.