IP = ''; } /** * Проверка файла на загрузку * @param $Fname * @param $file * @return bool */ function sysUPLOAD($Fname,$file){ //GLOBAL $_FILES; $out = false; $mes = $file."\n"; $mes .= print_r($_FILES,1); //file_put_contents('uplfile.txt',date('H:i:s d.m.Y').':'.$mes."\n",FILE_APPEND); if($this->check_file($file)){ if (move_uploaded_file($Fname,$file)){ $out = true; }else{ $out = false; } }else{ $out = false; } return $out; } /** * Проверка на расширение у файлов * @param $file * @return bool */ private function check_file($file){ $out = true; $parts = pathinfo($file); // Разрешенные расширения файлов. $allow = array(); // Запрещенные расширения файлов. $deny = array( 'phtml', 'php', 'php3', 'php4', 'php5', 'php6', 'php7', 'phps', 'cgi', 'pl', 'asp', 'aspx', 'shtml', 'shtm', 'htaccess', 'htpasswd', 'ini', 'log', 'sh', 'js', 'html', 'htm', 'css', 'sql', 'spl', 'scgi', 'fcgi' ); if (in_array(strtolower($parts['extension']), $deny)){ $out = false; } return $out; } }