src/Webtrees/Functions/Functions.php
public static function isValidPath($filename, $acceptfolder = FALSE) {		
		if(strpbrk($filename, $acceptfolder ? '?%*:|"<>' : '\\/?%*:|"<>') === FALSE) return true;
		return false;
	}
public static function isValidPath($filename, $acceptfolder = FALSE) {		
		if(strpbrk($filename, $acceptfolder ? '?%*:|"<>' : '\\/?%*:|"<>') === FALSE) return true;
		return false;
	}
public static function isValidPath ( $ filename , $ acceptfolder = FALSE ) { if ( strpbrk ( $ filename , $ acceptfolder ? '?%*:|"<>' : '\\/?%*:|"<>' ) === FALSE ) return true ; return false ; }
Check whether a path is under a valid form.

@param string $filename Filename path to check
@param boolean $acceptfolder Should folders be accepted?
@return boolean True if path valid
Check whether a path is under a valid form .