Ticket #7674: .patch
File .patch, 2.1 KB (added by , 7 years ago) |
---|
-
bp-core/bp-core-attachments.php
1314 1314 $cover_subdir = $object_data['dir'] . '/' . $bp_params['item_id'] . '/cover-image'; 1315 1315 $cover_dir = trailingslashit( $bp_attachments_uploads_dir['basedir'] ) . $cover_subdir; 1316 1316 1317 if ( 0 !== validate_file( $cover_dir ) ||! is_dir( $cover_dir ) ) {1317 if ( ! is_dir( $cover_dir ) ) { 1318 1318 // Upload error response. 1319 1319 bp_attachments_json_response( false, $is_html4, array( 1320 1320 'type' => 'upload_error', -
bp-core/classes/class-bp-attachment-cover-image.php
38 38 // Specific errors for cover images. 39 39 'upload_error_strings' => array( 40 40 11 => sprintf( __( 'That image is too big. Please upload one smaller than %s', 'buddypress' ), size_format( $max_upload_file_size ) ), 41 12 => sprintf( _n( 'Please upload only this file type: %s.', 'Please upload only these file types: %s.', count( $allowed_types ), 'buddypress' ), self::get_cover_image_types( $allowed_types ) ), 41 12 => sprintf( _n( 'Please upload only this file type: %s.', 'Please upload only these file types: %s.', count( $allowed_types ), 'buddypress' ), self::get_cover_image_types( $allowed_types ) ), 42 13 => __( 'There was a problem uploading the cover image.', 'buddypress' ) 42 43 ), 43 44 ) ); 44 45 } … … 77 78 // File size is too big. 78 79 if ( $file['size'] > $this->original_max_filesize ) { 79 80 $file['error'] = 11; 80 81 81 // File is of invalid type. 82 82 } elseif ( ! bp_attachments_check_filetype( $file['tmp_name'], $file['name'], bp_attachments_get_allowed_mimes( 'cover_image' ) ) ) { 83 83 $file['error'] = 12; 84 } 84 } else if( 0 !== validate_file( $file['name'] ) ) { 85 $file['error'] = 13; 86 } 85 87 86 88 // Return with error code attached. 87 89 return $file;