wordpress-cloud-media-offloader-plugin icon indicating copy to clipboard operation
wordpress-cloud-media-offloader-plugin copied to clipboard

When using root folder, you need to untrailslash line 178 in b2.php

Open jrhager84 opened this issue 5 years ago • 0 comments

When using root folder with b2, there's an additional trailing slash that breaks the links in the media library. starting at line 171:

return array( 'ID' => $attachment_id, 'filepath' => $filepath, 'filename' => basename( $filepath ), 'url' => wp_get_attachment_url( $attachment_id ), 'subdir' => trim( $uploads['subdir'], DIRECTORY_SEPARATOR ), 'destpath' => $remote_path . untrailingslashit( $uploads['subdir'] ), 'destfile' => $remote_path . untrailingslashit( $uploads['subdir'] ) . basename( $filepath ), // This is the line that went from trail to untrail 'mime_type' => get_post_mime_type( $attachment_id ) );

jrhager84 avatar Dec 15 '20 20:12 jrhager84