I am working on twenty fifteen theme uploaded buddy press plugin everything works fine. But when i am uploading profile cover image above error displaying , and cover image size is 900 by 600. Any help will be appreciated.
1 Answer
just change /wp-content/plugins/buddypress/bp-core/bp-core-attachments.php file
}
// Make sure the file path is safe.
if ( 0 !== validate_file( $r['image'] ) ) { //this to following one
if ( 1 === validate_file( $r['image'] ) ) {
return false;
}
$type_subdir = $r['object_dir'] . '/' . $r['item_id'] . '/' . $r['type'];
$type_dir = trailingslashit( $bp_attachments_uploads_dir['basedir'] ) . $type_subdir;
if ( 0 !== validate_file( $type_dir ) || ! is_dir( $type_dir ) ) { //this to following one
if ( 1 === validate_file( $type_dir ) || ! is_dir( $type_dir ) ) {
return $attachment_data;
}
$cover_subdir = $object_data['dir'] . '/' . $bp_params['item_id'] . '/cover-image';
$cover_dir = trailingslashit( $bp_attachments_uploads_dir['basedir'] ) . $cover_subdir;
if ( 0 !== validate_file( $cover_dir ) || ! is_dir( $cover_dir ) ) { //this to following one
if ( 1 === validate_file( $cover_dir ) || ! is_dir( $cover_dir ) ) {
// Upload error response.
bp_attachments_json_response( false, $is_html4, array(
'type' => 'upload_error',