This project is read-only.

Ampersand in media file name

Topics: General
May 25, 2014 at 5:12 PM
Orchard 1.8 allows you to upload media files with an ampersand (&) in the file name but when the image is requested it gets caught in the standard request validation. You get the error "A potentially dangerous Request.Path value was detected from the client". This was not an issue in previous versions because the ampersands were being replaced with underscores when importing media files.

I opened a bug a few month back which is still open but since it hasn't gotten too many votes so I'm guessing that it's not a big problem for others. So I'm wondering, do others have a workaround they are using? Or are you just training users to never use file names with ampersands? I have clients that seem to be running into this frequently.

I have considered removing the ampersand from the list of invalid characters in web.config.
<httpRuntime targetFramework="4.5" requestValidationMode="2.0" maxRequestLength="65536" requestPathInvalidCharacters="&lt;,&gt;,*,%,:,\,?" />
I'm unsure about doing this though. Any thoughts? Can anyone share what they are doing (if anything)?