mirror of
https://github.com/nokonoko/Uguu.git
synced 2024-01-06 13:35:15 +00:00
Update core.php
This commit is contained in:
parent
f6df8f516a
commit
b535210626
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user