
26.02.2012, 18:40
|
|
Новичок
Регистрация: 13.06.2010
Сообщений: 0
С нами:
8375537
Репутация:
0
|
|
Код:
// проверяем тип файла
$types = $cfg['filestype'] ? $cfg['filestype'] : 'jpeg,gif,png,jpg,bmp,zip,rar,tar';
$types = str_replace('php', '', $types);
$types = str_replace('htm', '', $types);
$types = str_replace('htaccess', '', $types);
$maytypes = explode(',', str_replace(' ', '', $types));
$path_parts = pathinfo($name);
// расширение файла
$ext = strtolower($path_parts['extension']);
// флаг существования расширения в разрешенных
$may = in_array($ext, $maytypes);
if(!$may) { cmsCore::addSessionMessage($_LANG['ERROR_TYPE_FILE'].': '.$types, 'error'); $inCore->redirectBack(); }
Как можно обойти проверку расширений?
|
|
|