CrossSiteScripting.php
public static function encode(String $string) : String
    {
        $secBadChars = self::$scriptBadChars;

        if( ! empty($secBadChars) )
        {
            foreach( $secBadChars as $badChar => $changeChar )
            {
                if( is_numeric($badChar) )
                {
                    $badChar = $changeChar;
                    $changeChar = '';
                }

                $badChar = trim($badChar, '/');

                $string = preg_replace('/'.$badChar.'/xi', $changeChar, $string);
            }
        }

        return $string;
    }
public static function encode(String $string) : String
    {
        $secBadChars = self::$scriptBadChars;

        if( ! empty($secBadChars) )
        {
            foreach( $secBadChars as $badChar => $changeChar )
            {
                if( is_numeric($badChar) )
                {
                    $badChar = $changeChar;
                    $changeChar = '';
                }

                $badChar = trim($badChar, '/');

                $string = preg_replace('/'.$badChar.'/xi', $changeChar, $string);
            }
        }

        return $string;
    }
public static function encode ( String $ string ) : String { $ secBadChars = self :: $ scriptBadChars ; if ( ! empty ( $ secBadChars ) ) { foreach ( $ secBadChars as $ badChar => $ changeChar ) { if ( is_numeric ( $ badChar ) ) { $ badChar = $ changeChar ; $ changeChar = '' ; } $ badChar = trim ( $ badChar , '/' ) ; $ string = preg_replace ( '/' . $ badChar . '/xi' , $ changeChar , $ string ) ; } } return $ string ; }
Encode Cross Site Scripting

@param string $string

@return string
Encode Cross Site Scripting