Skip to content

LinkUtil.GetMediaUrl adds unnecessary slash when domain is set #2

@zzzzBov

Description

@zzzzBov

If the sitecore link manager has alwaysIncludeServerUrl set to true, MediaManager.GetMediaUrl(mediaItem) will return a link along the lines of:

http://sub.domain.tld/~/media/Images/path/...

LinkUtil.GetMediaUrl line 16 shows:

return Sitecore.StringUtil.EnsurePrefix('/', Sitecore.Resources.Media.MediaManager.GetMediaUrl(mediaItem));

which will convert the produced URL into:

/http://sub.domain.tld/~media/Images/path/...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions