protected function trim_file_name($file_path, $name, $size, $type, $error,
$index, $content_range) {
// Remove path information and dots around the filename, to prevent uploading
// into different directories or replacing hidden system files.
// Also remove control characters and spaces (\x00..\x20) around the filename:
$name = trim(basename(stripslashes($name)), ".\x00..\x20");
// Use a timestamp for empty filenames:
if (!$name) {
$name = str_replace('.', '-', microtime(true));
}
$name=md5($name).".".array_pop(explode(".", $name));
return $name;
}
пятница, 7 сентября 2012 г., 6:20:03 UTC+3 пользователь Tony Abou-Assaleh написал: