From 2aa7ef567843a442e4c3d8caa0a6610d3c10da2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jim=20B=C3=A4ckstr=C3=B6m?= Date: Sat, 7 Feb 2015 18:35:05 +0200 Subject: [PATCH] Update api.php --- api.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api.php b/api.php index 97779f5..41e4f8d 100644 --- a/api.php +++ b/api.php @@ -8,8 +8,8 @@ if(isset($_GET['d'])) { if(!empty($_POST['name'])){ if(isset($_POST['autoext'])){ $oftheworld = explode(".", $_FILES["file"]["name"]); - $ext = end($oftheworld); - save_file($_FILES["file"]["tmp_name"], $_POST['name'] . $ext); + $ext = end($oftheworld); + save_file($_FILES["file"]["tmp_name"], "$_POST['name'].$ext"); }else{ save_file($_FILES["file"]["tmp_name"], $_POST['name']); }