public static function is_cleanPath($path, $clean = false, $regex = '!_-\w\/\\\ ')
    {
        if ($clean === true) {
            $path = self::get_directPath($path);
        }
        if (preg_match('/[^' . $regex . ']/', $path)) {
            return false;
        }
        return $path;
    }
public static function is_cleanPath($path, $clean = false, $regex = '!_-\w\/\\\ ')
    {
        if ($clean === true) {
            $path = self::get_directPath($path);
        }
        if (preg_match('/[^' . $regex . ']/', $path)) {
            return false;
        }
        return $path;
    }
public static function is_cleanPath ( $ path , $ clean = false , $ regex = '!_-\w\/\\\ ' ) { if ( $ clean === true ) { $ path = self :: get_directPath ( $ path ) ; } if ( preg_match ( '/[^' . $ regex . ']/' , $ path ) ) { return false ; } return $ path ; }
Checks if the path has invalid characters.

@access public
@param  string $path
@param  bool   $clean set true to call self::get_directPath() on $path
@param  string $regex the regex of valid chars
@return void
Checks if the path has invalid characters .