public function htmlXssClean()
    {
        static $antiXss = null;

        if ($antiXss === null)
        {
            if (class_exists('\\voku\\helper\\AntiXSS'))
            {
                $antiXss = new \voku\helper\AntiXSS();
            }
            else
            {
                throw new \RuntimeException
                (
                    "This method requires \voku\helper\AntiXSS. ".
                    "Install with: composer require voku/anti-xss"
                );
            }
        }

        return $this->newSelf($antiXss->xss_clean($this->scalarString));
    }
public function htmlXssClean()
    {
        static $antiXss = null;

        if ($antiXss === null)
        {
            if (class_exists('\\voku\\helper\\AntiXSS'))
            {
                $antiXss = new \voku\helper\AntiXSS();
            }
            else
            {
                throw new \RuntimeException
                (
                    "This method requires \voku\helper\AntiXSS. ".
                    "Install with: composer require voku/anti-xss"
                );
            }
        }

        return $this->newSelf($antiXss->xss_clean($this->scalarString));
    }
public function htmlXssClean ( ) { static $ antiXss = null ; if ( $ antiXss === null ) { if ( class_exists ( '\\voku\\helper\\AntiXSS' ) ) { $ antiXss = new \ voku \ helper \ AntiXSS ( ) ; } else { throw new \ RuntimeException ( "This method requires \voku\helper\AntiXSS. " . "Install with: composer require voku/anti-xss" ) ; } } return $ this -> newSelf ( $ antiXss -> xss_clean ( $ this -> scalarString ) ) ; }
Sanitizes data so that Cross Site Scripting Hacks can be prevented.

This method does a fair amount of work and it is extremely thorough,
designed to prevent even the most obscure XSS attempts. Nothing is ever
100 percent foolproof, of course, but I haven't been able to get anything
passed the filter.

> NOTE: Should only be used to deal with data upon submission.
> It's not something that should be used for general runtime processing.

__In other words it is still critically important
to escape anything that you output!!!__

This uses a packaged version of the Anti XSS Library from CodeIgniter.
@link https://github.com/voku/anti-xss

@return static
Sanitizes data so that Cross Site Scripting Hacks can be prevented .