<?php
-function save_file ($file, $name, $arg){
+function save_file ($file, $name, $arg, $type){
//Where to save
$path='/home/neku/www/files/';
$block = array('exe', 'scr', 'rar', 'zip', 'com', 'vbs', 'bat', 'cmd', 'html', 'htm', 'msi');
$ext = pathinfo($file.$name, PATHINFO_EXTENSION);
$ext = strtolower($ext);
if(in_array($ext, $block)){
+ if($type==='normal'){
include_once('error_meow.php');
- exit(0);}
+ exit(0);
+ }else{
+ exit('File type not allowed.');
+ }
+ }
$file_name = gen_name('random', $ext);
while(file_exists($path.$file_name)){
$file_name = gen_name('random', $ext);
$ext = pathinfo($file_name, PATHINFO_EXTENSION);
$ext = strtolower($ext);
if(in_array($ext, $block)){
- include_once('error_meow.php');
- exit(0);}
+ if($type==='normal'){
+ include_once('error_meow.php');
+ exit(0);
+ }else{
+ exit('File type not allowed.');
+ }
+ }
while(file_exists($path.$file_name)){
$file_name = gen_name('custom_original', $name);
}