Skip to main content
Update with official support patch
Source Link
Jason St-Cyr
  • 6.8k
  • 1
  • 19
  • 46

While investigating this issue when I hit it during an upgrade, my debugging discovered that this was caused by a bug in the PortectedImageLinkRenderer class which cannot handle empty <a> tags. In my scenario, I had some HTML in the rich text field as follows:

<a>Some Text Here</a>

When the pipeline tried to process the 'HREF' tag of the anchor, it couldn't find it but the algorithm didn't safely handle this scenario, leading to the exception above.

I was able to patch in my own version of the ProtectedImageLinkRenderer which handled the empty tags and it resolved the issue. @Velict, you may wish to do the same if you need to have empty tags. Alternatively, you can add an HREF tag to your empty anchors and it will work.

I have also submitted a support ticket to Sitecore, referencing 8.2 update 2, to request an official patch. I'll update this answer if I hear back.

UPDATE: I don't have an official patch yet, but my debugging to help the support desk did uncover that this requires a very specific combination. The HTML must have an empty tag and ALSO a media link that needs to be processed. Either of them on their own is fine.

The following HTML example can reproduce the issue in a default Sitecore 8.2 u2 installation by editing the 'Text' field of the default Home node:

<p><a>Empty HREF</a></p>
<p><a href="-/media/094AED0302E7486880CB19926661FB77.ashx">Media link</a></p>

UPDATE (2017-03-01): I have received an official support patch for 8.2update 2 for this from Sitecore: https://github.com/SitecoreSupport/Sitecore.Support.149817/releases/tag/8.2.2.0

While investigating this issue when I hit it during an upgrade, my debugging discovered that this was caused by a bug in the PortectedImageLinkRenderer class which cannot handle empty <a> tags. In my scenario, I had some HTML in the rich text field as follows:

<a>Some Text Here</a>

When the pipeline tried to process the 'HREF' tag of the anchor, it couldn't find it but the algorithm didn't safely handle this scenario, leading to the exception above.

I was able to patch in my own version of the ProtectedImageLinkRenderer which handled the empty tags and it resolved the issue. @Velict, you may wish to do the same if you need to have empty tags. Alternatively, you can add an HREF tag to your empty anchors and it will work.

I have also submitted a support ticket to Sitecore, referencing 8.2 update 2, to request an official patch. I'll update this answer if I hear back.

UPDATE: I don't have an official patch yet, but my debugging to help the support desk did uncover that this requires a very specific combination. The HTML must have an empty tag and ALSO a media link that needs to be processed. Either of them on their own is fine.

The following HTML example can reproduce the issue in a default Sitecore 8.2 u2 installation by editing the 'Text' field of the default Home node:

<p><a>Empty HREF</a></p>
<p><a href="-/media/094AED0302E7486880CB19926661FB77.ashx">Media link</a></p>

While investigating this issue when I hit it during an upgrade, my debugging discovered that this was caused by a bug in the PortectedImageLinkRenderer class which cannot handle empty <a> tags. In my scenario, I had some HTML in the rich text field as follows:

<a>Some Text Here</a>

When the pipeline tried to process the 'HREF' tag of the anchor, it couldn't find it but the algorithm didn't safely handle this scenario, leading to the exception above.

I was able to patch in my own version of the ProtectedImageLinkRenderer which handled the empty tags and it resolved the issue. @Velict, you may wish to do the same if you need to have empty tags. Alternatively, you can add an HREF tag to your empty anchors and it will work.

I have also submitted a support ticket to Sitecore, referencing 8.2 update 2, to request an official patch. I'll update this answer if I hear back.

UPDATE: I don't have an official patch yet, but my debugging to help the support desk did uncover that this requires a very specific combination. The HTML must have an empty tag and ALSO a media link that needs to be processed. Either of them on their own is fine.

The following HTML example can reproduce the issue in a default Sitecore 8.2 u2 installation by editing the 'Text' field of the default Home node:

<p><a>Empty HREF</a></p>
<p><a href="-/media/094AED0302E7486880CB19926661FB77.ashx">Media link</a></p>

UPDATE (2017-03-01): I have received an official support patch for 8.2update 2 for this from Sitecore: https://github.com/SitecoreSupport/Sitecore.Support.149817/releases/tag/8.2.2.0

Updated with additional debugging details
Source Link
Jason St-Cyr
  • 6.8k
  • 1
  • 19
  • 46

While investigating this issue when I hit it during an upgrade, my debugging discovered that this was caused by a bug in the PortectedImageLinkRenderer class which cannot handle empty <a> tags. In my scenario, I had some HTML in the rich text field as follows:

<a>Some Text Here</a>

When the pipeline tried to process the 'HREF' tag of the anchor, it couldn't find it but the algorithm didn't safely handle this scenario, leading to the exception above.

I was able to patch in my own version of the ProtectedImageLinkRenderer which handled the empty tags and it resolved the issue. @Velict, you may wish to do the same if you need to have empty tags. Alternatively, you can add an HREF tag to your empty anchors and it will work.

I have also submitted a support ticket to Sitecore, referencing 8.2 update 2, to request an official patch. I'll update this answer if I hear back.

UPDATE: I don't have an official patch yet, but my debugging to help the support desk did uncover that this requires a very specific combination. The HTML must have an empty tag and ALSO a media link that needs to be processed. Either of them on their own is fine.

The following HTML example can reproduce the issue in a default Sitecore 8.2 u2 installation by editing the 'Text' field of the default Home node:

<p><a>Empty HREF</a></p>
<p><a href="-/media/094AED0302E7486880CB19926661FB77.ashx">Media link</a></p>

While investigating this issue when I hit it during an upgrade, my debugging discovered that this was caused by a bug in the PortectedImageLinkRenderer class which cannot handle empty <a> tags. In my scenario, I had some HTML in the rich text field as follows:

<a>Some Text Here</a>

When the pipeline tried to process the 'HREF' tag of the anchor, it couldn't find it but the algorithm didn't safely handle this scenario, leading to the exception above.

I was able to patch in my own version of the ProtectedImageLinkRenderer which handled the empty tags and it resolved the issue. @Velict, you may wish to do the same if you need to have empty tags. Alternatively, you can add an HREF tag to your empty anchors and it will work.

I have also submitted a support ticket to Sitecore, referencing 8.2 update 2, to request an official patch. I'll update this answer if I hear back.

While investigating this issue when I hit it during an upgrade, my debugging discovered that this was caused by a bug in the PortectedImageLinkRenderer class which cannot handle empty <a> tags. In my scenario, I had some HTML in the rich text field as follows:

<a>Some Text Here</a>

When the pipeline tried to process the 'HREF' tag of the anchor, it couldn't find it but the algorithm didn't safely handle this scenario, leading to the exception above.

I was able to patch in my own version of the ProtectedImageLinkRenderer which handled the empty tags and it resolved the issue. @Velict, you may wish to do the same if you need to have empty tags. Alternatively, you can add an HREF tag to your empty anchors and it will work.

I have also submitted a support ticket to Sitecore, referencing 8.2 update 2, to request an official patch. I'll update this answer if I hear back.

UPDATE: I don't have an official patch yet, but my debugging to help the support desk did uncover that this requires a very specific combination. The HTML must have an empty tag and ALSO a media link that needs to be processed. Either of them on their own is fine.

The following HTML example can reproduce the issue in a default Sitecore 8.2 u2 installation by editing the 'Text' field of the default Home node:

<p><a>Empty HREF</a></p>
<p><a href="-/media/094AED0302E7486880CB19926661FB77.ashx">Media link</a></p>
Source Link
Jason St-Cyr
  • 6.8k
  • 1
  • 19
  • 46

While investigating this issue when I hit it during an upgrade, my debugging discovered that this was caused by a bug in the PortectedImageLinkRenderer class which cannot handle empty <a> tags. In my scenario, I had some HTML in the rich text field as follows:

<a>Some Text Here</a>

When the pipeline tried to process the 'HREF' tag of the anchor, it couldn't find it but the algorithm didn't safely handle this scenario, leading to the exception above.

I was able to patch in my own version of the ProtectedImageLinkRenderer which handled the empty tags and it resolved the issue. @Velict, you may wish to do the same if you need to have empty tags. Alternatively, you can add an HREF tag to your empty anchors and it will work.

I have also submitted a support ticket to Sitecore, referencing 8.2 update 2, to request an official patch. I'll update this answer if I hear back.