Duplicate hash parameters in image links


Description

When rendering an image with a link wrapping it, the image protection hash is added to the URL twice.

For example, the following code:

@Html.Sitecore().Field("Link", Model.Item, new { text = @Html.Sitecore().Field("Image", Model.Item) })

will add two hash attributes on the IMG tag and cause an error:

<a href="/"><img src="/-/media/Images/Image.ashx?h=65&amp;la=en&amp;w=230&amp;hash=11E08BC86FF041320282A22BA00C6711EEB3D189&amp;hash=11E08BC86FF041320282A22BA00C6711EEB3D189" alt="Image" width="230" height="65" /></a>

Solution

To resolve this issue, download and apply the appropriate patch available on this page: https://github.com/SitecoreSupport/Sitecore.Support.97023/releases.