silverstripe / silverstripe-assets

Silverstripe Assets component
BSD 3-Clause "New" or "Revised" License
9 stars 65 forks source link

History Preview - unterminated entity reference stage=Stage #520

Open rafaeldsousa opened 1 year ago

rafaeldsousa commented 1 year ago

The following is triggering a warning when trying to parse a not found file and the error page is loaded instead. This seems to be caused because the returned Link is not parsed. https://github.com/silverstripe/silverstripe-assets/blob/ce9464b6282c34e37324987ea2dd74cae89c50ca/src/Shortcodes/FileShortcodeProvider.php#L102

Steps to reproduce

SilverStripe\View\Parsers\ShortcodeParser::replaceAttributeTagsWithContent(): unterminated entity reference stage=Stage
GET /YOUR_PAGE/?stage=Stage&archiveDate=2021-08-18%2019%3A58%3A11
Line 478 in /Users/.../vendor/silverstripe/framework/src/View/Parsers/ShortcodeParser.php

Note that the error is only reported all the way back up at ShortcodeParser - replaceAttributeTagsWithContent.