WordPress.org

Make WordPress Core

Ticket #41753: 41753

File 41753, 511 bytes (added by nikolastoqnow, 5 months ago)
Line 
1@@ -963 +963,5 @@ function _wp_get_attachment_relative_path( $file )
2-       if ( false !== strpos( $dirname, 'wp-content/uploads' ) ) {
3+       $upload_dirs_and_urls = wp_upload_dir();
4+       $base_upload_dir = $upload_dirs_and_urls['basedir'];
5+
6+       if ( false !== strpos( $dirname, $base_upload_dir ) ) {
7+
8@@ -965 +969 @@ function _wp_get_attachment_relative_path( $file )
9-               $dirname = substr( $dirname, strpos( $dirname, 'wp-content/uploads' ) + 18 );
10+               $dirname = substr( $dirname, strlen( $base_upload_dir ) );