diff --git a/index.php b/index.php index 1bec7cf..2cf38db 100644 --- a/index.php +++ b/index.php @@ -137,7 +137,8 @@ else if (isset($_POST['action'])) case 'sendfile': $file=urldecode($_POST['name']); $filedetail = pathinfo($file); - $data=$_POST['file']; + $data=file_get_contents($_FILES["file"]["tmp_name"]); + unlink($_FILES["file"]["tmp_name"]); if (!isset($_SESSION['md_admin'])) { $content=specialurl("/:ADMIN",true); diff --git a/js/functionsadmin.js b/js/functionsadmin.js index 2b30f1f..99ead1b 100644 --- a/js/functionsadmin.js +++ b/js/functionsadmin.js @@ -366,7 +366,6 @@ function sendmode(data) { $(window).scrollTop(0); $("#editor").hide(); - if (data !== undefined) editor.value(data); $("#content").show(); $("#save").hide(); $("#image").hide(); @@ -374,7 +373,7 @@ function sendmode(data) $("#voir").val("Voir"); $("#content").html('

'+LANG['UPLOAD_MSG']+'

'); let dropArea = document.getElementById("drop-area") - dropArea.replaceWith(dropArea.cloneNode(true)); + //dropArea.replaceWith(dropArea.cloneNode(true)); ;['dragenter', 'dragover', 'dragleave', 'drop'].forEach(eventName => { dropArea.addEventListener(eventName, preventDefaults, false)