{
if ($path == ''//|| $path == '.' || $path == '..'
) return 0;
-
+
return is_writable($path) ? (is_dir($path) ? 1 : -1)
- : (is_file($path) ? 0 : ($path == '.' ? 0 : check_write(dirname($path))));
+ : (is_file($path) ? 0 : ($path == '.' || $path == '..' ? 0 : check_write(dirname($path))));
}
/*
Changes all not POSIX compatible chars to underscore.
*/
function clean_file_name($filename) {
+ $filename = str_replace(chr(0), '', $filename);
return preg_replace('/[^a-zA-Z0-9.\-_]/', '_', $filename);
}