Support Joomla!

Joomla! 1.5 Documentation

Packages

Package: patTemplate

Developer Network License

The Joomla! Developer Network content is © copyright 2006 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution- NonCommercial- ShareAlike 2.5
Source code for file /pattemplate/patTemplate/InputFilter/StripComments.php

Documentation is available at StripComments.php

  1. <?PHP
  2. /**
  3.  * patTemplate StripComments input filter
  4.  *
  5.  * $Id: StripComments.php 47 2005-09-15 02:55:27Z rhuk $
  6.  *
  7.  * Will remove all HTML comments.
  8.  *
  9.  * @package        patTemplate
  10.  * @subpackage    Filters
  11.  * @author        Stephan Schmidt <[email protected]>
  12.  */
  13.  
  14. // Check to ensure this file is within the rest of the framework
  15. defined('JPATH_BASE'or die();
  16.  
  17. /**
  18.  * patTemplate StripComments output filter
  19.  *
  20.  * $Id: StripComments.php 47 2005-09-15 02:55:27Z rhuk $
  21.  *
  22.  * Will remove all HTML comments.
  23.  *
  24.  * @package        patTemplate
  25.  * @subpackage    Filters
  26.  * @author        Stephan Schmidt <[email protected]>
  27.  */
  28. {
  29.    /**
  30.     * filter name
  31.     *
  32.     * @access    protected
  33.     * @abstract
  34.     * @var    string 
  35.     */
  36.     var    $_name    =    'StripComments';
  37.  
  38.    /**
  39.     * compress the data
  40.     *
  41.     * @access    public
  42.     * @param    string        data
  43.     * @return    string        data without whitespace
  44.     */
  45.     function apply$data )
  46.     {
  47.         //$data = preg_replace( '�<!--.*-->�msU', '', $data );
  48.         //$data = preg_replace( '�/\*.*\*/�msU', '', $data );
  49.         $data preg_replace'°<!--.*-->°msU'''$data );
  50.         $data preg_replace'°/\*.*\*/°msU'''$data );
  51.  
  52.         return $data;
  53.     }
  54. }
  55. ?>

Documentation generated on Mon, 05 Mar 2007 21:27:15 +0000 by phpDocumentor 1.3.1