diff --git a/upload/backend/media/upload.php b/upload/backend/media/upload.php
index a322b740..798cc3f3 100755
--- a/upload/backend/media/upload.php
+++ b/upload/backend/media/upload.php
@@ -12,7 +12,6 @@
* @license http://www.gnu.org/licenses/gpl.html
* @license_terms please see LICENSE and COPYING files in your package
*
- *
*/
// include class.secure.php to protect this file and the whole CMS!
@@ -59,6 +58,10 @@
{
$admin->print_error( 'No directory was selected', false );
}
+ if ( !is_writeable($file_path) )
+ {
+ $admin->print_error( 'Directory is not writeable.', false );
+ }
$upload_counter = $admin->get_post('upload_counter');
$file_overwrite = $admin->get_post('overwrite');
// ============================================================================
@@ -83,22 +86,7 @@
// =======================================
// ! Try to include the upload.class.php
// =======================================
- // =======================================
- // ! Try to include the Zip-Helper.php
- // =======================================
- $helper_link = sanitize_path( LEPTON_PATH . '/framework/LEPTON/Helper/Upload.php' );
- if ( file_exists( $helper_link ) )
- {
- require_once( $helper_link );
- }
- else {
- $admin->print_error('The Upload helper was not found. Please check if "' . $helper_link . '" is installed.', false);
- }
-
- // ===============================
- // ! Create the class for PclZip
- // ===============================
- $files = new LEPTON_Helper_Upload( $_FILES[$file_name] );
+ $files = $admin->get_helper('LEPTON_Helper_Upload', $_FILES[$file_name]);
if ( $files->uploaded )
{
diff --git a/upload/framework/LEPTON/Helper/Upload.php b/upload/framework/LEPTON/Helper/Upload.php
index 2ca4385e..a820fe9b 100644
--- a/upload/framework/LEPTON/Helper/Upload.php
+++ b/upload/framework/LEPTON/Helper/Upload.php
@@ -709,7 +709,7 @@ function LEPTON_Helper_Upload( $file )
{
$this->no_upload_check = TRUE;
// this is a local filename, i.e.not uploaded
- $this->log .= '' . $this->translate("source is a local file") . ' ' . $file . '
';
+ $this->log .= 'Source is a local file ' . $file . '
';
if ($this->uploaded && !file_exists($file))
{
diff --git a/upload/templates/freshcat/js/backend_media.js b/upload/templates/freshcat/js/backend_media.js
index 5951db68..fd8c7a35 100644
--- a/upload/templates/freshcat/js/backend_media.js
+++ b/upload/templates/freshcat/js/backend_media.js
@@ -609,13 +609,13 @@ jQuery(document).ready(function()
// Activate the upload form to send data with ajax
dialog_form(
- $('#fc_media_index_upload'), function()
+ $('#fc_media_index_upload'), function( data )
{
var current_ul = get_active_media(),
folder_path = current_ul.find('input[name=folder_path]').val();
$('#fc_media_index_upload input[name=folder_path]').val( folder_path );
- }, function()
+ }, function( data, textStatus, jqXHR )
{
var media_upload = $('#fc_media_index_upload'),
reload_ul = get_active_media();
diff --git a/upload/templates/freshcat/js/general.js b/upload/templates/freshcat/js/general.js
index bc181222..4199ef6d 100644
--- a/upload/templates/freshcat/js/general.js
+++ b/upload/templates/freshcat/js/general.js
@@ -369,12 +369,15 @@ function dialog_form( currentForm, beforeSend, afterSend )
}
else {
// else return error
- return_error( jqXHR.process , data.message);
+ return_error( jqXHR.process , $( data ).find('.fc_error_box > p').text());
}
},
error: function( jqXHR, textStatus, errorThrown )
{
jqXHR.process.remove();
+ console.log(jqXHR);
+ console.log(textStatus);
+ console.log(errorThrown);
alert(textStatus + ': ' + errorThrown );
}
});
diff --git a/upload/templates/freshcat/templates/form_upload_files.lte b/upload/templates/freshcat/templates/form_upload_files.lte
index 482581ca..2ea4f687 100644
--- a/upload/templates/freshcat/templates/form_upload_files.lte
+++ b/upload/templates/freshcat/templates/form_upload_files.lte
@@ -1,6 +1,6 @@