Resolved
Resolved in: WPML 4.9.3
Overview of the issue
When content is translated and the Media Translation plugin is active, the image urls in the translated content may include double slashes. The images still appear as normal, but this can have some unintended side-effects with 3rd parties.
Note, this issue only happens if the default WordPress setting “Organize my uploads into month- and year-based folders” is disabled.
Workaround
While awaiting a fix, the problem can be avoided (for new translations) by editing the file plugins/wpml-media-translation/classes/media-translation/class-wpml-media-image-translate.php
Locate these lines (around line 211):
$filename = array_pop( $file_subdirectory_parts ); $image_url_parts[] = implode( '/', $file_subdirectory_parts );
and edit like so:
$filename = array_pop( $file_subdirectory_parts );
if ( !empty( $file_subdirectory_parts ) ) {
$image_url_parts[] = implode( '/', $file_subdirectory_parts );
}