Skip to content

Commit 83af7de

Browse files
committed
fix problem with upload files and problem with get_image
1 parent 050b9ac commit 83af7de

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

admin/mf_upload.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ function valid_mime($mime,$file_type){
7878
@chmod(MF_FILES_DIR . $filename, 0644);
7979
$info = pathinfo(MF_FILES_DIR . $filename);
8080

81-
$thumb = aux_image($filename,"w=150&h=120&zc=1",'image_alt');
81+
$thumb = ($_GET['type'] == 'image') ? aux_image($filename,"w=150&h=120&zc=1",'image_alt') : "";
8282
$resp = array(
8383
'error' => false,
8484
'name' => $filename,

mf_front_end.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -342,11 +342,13 @@ function create_image($options){
342342
}else{
343343
//generate or check de thumb
344344
$field_value = aux_image($field_value,$field_param,$field_type);
345-
if ( is_wp_error($field_value) && defined('WP_DEBUG') && WP_DEBUG == true ){
346-
return sprintf("%s: %s",__('Error generating thumbnail, reason',$mf_domain),$field_value->get_error_message());
345+
if ( is_wp_error($field_value)){
346+
if (defined('WP_DEBUG') && WP_DEBUG == true) {
347+
return sprintf("%s: %s",__('Error generating thumbnail, reason',$mf_domain),$field_value->get_error_message());
348+
} else {
349+
return "";
350+
}
347351
}
348-
349-
return "";
350352

351353
}
352354

0 commit comments

Comments
 (0)