public static function validate($input, $separator = self::SEPARATOR_BOTH){

        $pattern = addcslashes(self::ALLOWED_CHARS . $separator, "[].-_/\\");
        $invalid = preg_match("/[^".$pattern."]+/", $input);

        return $invalid ? false : true;
    }
public static function validate($input, $separator = self::SEPARATOR_BOTH){

        $pattern = addcslashes(self::ALLOWED_CHARS . $separator, "[].-_/\\");
        $invalid = preg_match("/[^".$pattern."]+/", $input);

        return $invalid ? false : true;
    }
public static function validate ( $ input , $ separator = self :: SEPARATOR_BOTH ) { $ pattern = addcslashes ( self :: ALLOWED_CHARS . $ separator , "[].-_/\\" ) ; $ invalid = preg_match ( "/[^" . $ pattern . "]+/" , $ input ) ; return $ invalid ? false : true ; }
Check if a path contains valid characters

@static
@param        $input
@param string $separator
@return bool
Check if a path contains valid characters