
Added by thebman220 on July-2-2008, 10:39 pm
function is_valid_filename($name) {
$parts=preg_split("/(\/|".preg_quote("\\").")/",$name);
if (preg_match("/[a-z]:/i",$parts[0])) {
unset($parts[0]);
}
foreach ($parts as $part) {
if (
preg_match("/[".preg_quote("^|?*<\":>","/")."\a\b\c\e\x\v\s]/",$part)||
preg_match("/^(PRN|CON|AUX|CLOCK$|NUL|COMd|LPTd)$/im",str_replace(".","\n",$part))
) {
return false;
}
}
return true;
}
?>
Added by thebman220 on May-2-2009, 4:40 am
Added by thebman220 on April-29-2009, 11:47 pm
Added by thebman220 on April-5-2009, 1:48 pm
Added by thebman220 on January-29-2009, 3:15 am
Added by thebman220 on January-29-2009, 3:04 am