src/Core/Helpers/Util.php
/**
	 * Remove Invisible Characters
	 *
	 * This prevents sandwiching null characters
	 * between ascii characters, like Java\0script.
	 *
	 * @param    string
	 * @param    bool
	 * @return    string
	 */
Remove Invisible Characters
This prevents sandwiching null characters
between ascii characters, like Java\0script.

@param    string
@param    bool
@return    string
Remove Invisible Characters This prevents sandwiching null characters between ascii characters like Java \ 0script . @param string @param bool @return string
public static function removeInvisibleCharacters($str, $url_encoded = TRUE)
	{
		$non_displayables = array();
		if ($url_encoded) {
			$non_displayables[] = '/%0[0-8bcef]/';    
			$non_displayables[] = '/%1[0-9a-f]/';    
		}
		$non_displayables[] = '/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]+/S';    
		do {
			$str = preg_replace($non_displayables, '', $str, -1, $count);
		} while ($count);
		return $str;
	}
public static function removeInvisibleCharacters ( $ str , $ url_encoded = TRUE ) { $ non_displayables = array ( ) ; if ( $ url_encoded ) { $ non_displayables [ ] = '/%0[0-8bcef]/' ; $ non_displayables [ ] = '/%1[0-9a-f]/' ; } $ non_displayables [ ] = '/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]+/S' ; do { $ str = preg_replace ( $ non_displayables , '' , $ str , - 1 , $ count ) ; } while ( $ count ) ; return $ str ; }
Remove Invisible Characters
 This prevents sandwiching null characters
 between ascii characters, like Java\0script.
Remove Invisible Characters This prevents sandwiching null characters between ascii characters like Java \ 0script .
// every control character except newline (dec 10), // carriage return (dec 13) and horizontal tab (dec 09) // url encoded 00-08, 11, 12, 14, 15 // url encoded 16-31 // 00-08, 11, 12, 14-31, 127