get_updated_upload_url incorrectly replace URLs with double slash
-
The function “get_updated_upload_url” causes old media URL to have double forward-slashes.
line 551,
$upload_dir_url = $wp_upload_dir['baseurl']; $storage_url_prefix = WindowsAzureStorageUtil::get_storage_url_base(); return str_replace( $upload_dir_url, $storage_url_prefix, $url );
“$upload_dir_url” return value without trailing slash, but “$storage_url_prefix” returns value with trailing slash.
Should remove the trailing slash before doing string replace, i.e. add the following before “str_replace”
$storage_url_prefix = untrailingslashit( $storage_url_prefix );
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘get_updated_upload_url incorrectly replace URLs with double slash’ is closed to new replies.