]> jfr.im git - uguu.git/commitdiff
Update core.php
authorEric Johansson (neku) <redacted>
Wed, 7 Oct 2015 20:56:03 +0000 (22:56 +0200)
committerEric Johansson (neku) <redacted>
Wed, 7 Oct 2015 20:56:03 +0000 (22:56 +0200)
includes/core.php

index 29cfdb0c0d8566cca029cfa4fb5afe2a51b00365..7a1e4d621dcfad15224f97ea022ed7e0a7b86178 100644 (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);
             }