Update core.php

This commit is contained in:
Eric Johansson (neku) 2015-10-07 22:56:03 +02:00
parent f6df8f516a
commit b535210626
1 changed files with 14 additions and 4 deletions

View File

@ -1,5 +1,5 @@
<?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');
@ -9,8 +9,13 @@ function save_file ($file, $name, $arg){
$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);
@ -23,8 +28,13 @@ function save_file ($file, $name, $arg){
$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);
}