Update core.php

This commit is contained in:
COLE Edouard 2016-09-14 14:00:34 +02:00 committed by GitHub
parent d59579ad8f
commit 5e0494bbb1
1 changed files with 5 additions and 3 deletions

View File

@ -3,7 +3,7 @@
require_once "config.php";
//Saving the file on the server
function save_file ($file, $name, $arg, $type){
function save_file ($file, $name, $arg, $type,$withNewLine=false){
//Generate name depending on arg
switch($arg){
case 'random':
@ -47,9 +47,11 @@ function save_file ($file, $name, $arg, $type){
if($type==='tool'){
//Return url+filename to the user (plain text)
if(CONFIG_SUBUPLOAD_URL_ENABLED == "true"){
echo CONFIG_SUBUPLOAD_URL.'/'.urlencode($file_name)."\n";
echo CONFIG_SUBUPLOAD_URL.'/'.urlencode($file_name);
if ($withNewLine) echo "\n";
}else{
echo CONFIG_ROOT_URL.'/files/'.urlencode($file_name)."\n";
echo CONFIG_ROOT_URL.'/files/'.urlencode($file_name);
if ($withNewLine) echo "\n";
}
exit(0);
}elseif($type==='normal'){