Page 1 of 1

News Module replacing dash in filenames

Posted: Thu Jan 23, 2020 8:12 am
by moonie
Hello everyone

I've noticed on 3 different installations that the latest News module (2.51.8 under the latest CMS Version 2.2.13) keeps replacing dashes in file uploads to - instead. So a file-name.jpg becomes a file-name.jpg. Underscores are still working and don't get replaced.

This wasn't the case in News 2.51.6 and CMS 2.2.12 for instance. Any idea in what file to look to find the replacing logic?

Re: News Module replacing dash in filenames

Posted: Thu Jan 23, 2020 3:22 pm
by DIGI3
There's a bug report for this: http://dev.cmsmadesimple.org/bug/view/12207

My workaround has been to use |replace in the template, something like

Code: Select all

<img src="{$item->fielddefs.image|replace:'&#45;':'-'}" />
or if you're using CGSmartImage it seems to handle it okay.