Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix #382 - Wrong upload path for this upload route and removal of som…
…e redundant code
  • Loading branch information
JohnSmith-LT committed May 25, 2016
1 parent 4e23ec4 commit f35a58b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
2 changes: 1 addition & 1 deletion editor/js/toolbox.js
Expand Up @@ -1673,7 +1673,7 @@ var EDITOR = (function ($, parent) {
var input = $('<input>')
.attr('type', 'hidden')
.attr('name', 'rlofile')
.attr('value', rlopathvariable);
.attr('value', rlopathvariable.substr(rlopathvariable.indexOf("USER-FILES")));

drawingForm.append(input);

Expand Down
15 changes: 2 additions & 13 deletions modules/site/engine/upload.php
Expand Up @@ -60,23 +60,14 @@
*/
require_once("../../../config.php");

require_once("../../../plugins.php");

/**
* Now we check that the session has a valid, logged in user
*/
if (!isset($_SESSION['toolkits_logon_username'])) {
die("Not logged in; perhaps session has timed out?");
}


if (!empty($_FILES)) {
if(!apply_filters('editor_upload_file', $_FILES)) {
_debug("file upload for " . print_r($_FILES, true) . " failed. ");
die("File upload failed; check server logs.");
}
}
else {
if (empty($_FILES)) {
die("No file(s) uploaded");
}

Expand All @@ -101,6 +92,4 @@
if (!move_uploaded_file($_FILES['Filedata']['tmp_name'], $new_file_name)) {
receive_message($_SESSION['toolkits_logon_username'], "UPLOAD", "CRITICAL", "Error saving file: " . $new_file_name, "Error saving file: " . error_get_last());
die("Couldn't move uploaded file into place.");
}

apply_filters('editor_post_upload_file', $new_file_name);
}

0 comments on commit f35a58b

Please sign in to comment.