You need to be logged in to post in the forum - Log In

An active JCE Pro Subscription is required to post in the forum - Buy a Subscription

Support is currently Offline

Official support hours
Monday to Friday
09:00 - 17:00 Europe/London (BST)

Please create a new Ticket and we will get back to you as soon as we can.

#100799 Broken images with date in file name

Posted in ‘Editor’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Latest post by ctx2011 on Friday, 16 August 2019 13:00 BST

ctx2011
Hi Ryan, I just ran into a weird problem and I am not sure even whether this is a JCE problem or Joomla problem.
There was an old site I updated in terms of the template (and some content changes). The dev site was under a subdomain (same server). Today I replaced the old site with the new one and images with file names starting with a date in yyyy-mm-dd format broke. I could get them back by changing the file name to yyyy_mm_dd (using underscore instead of hyphen), still, this is something that should not have happened. I used Akeeba Backup's restore functionality to replace the old site, and the image on the front page did not display. I tried to reupload it with no success. JCE File Browser and Image Manager Extended does not show it either. I see that that file is there but no preview until I remove the date from the beginning. On the screenshot attached, you can see the file with and without the date at the beginning (same file). I already updated to JCE PRO 2.7.16.
Any idea why?
Thanks
Krisztina

Attachments

Ryan
The first thing that comes to mind is that the site has an htaccess rule that blocks certain file types, and the regular expression that it uses to do this does not allow for the dash character in file names, eg: ([a-z0-9_]+)\.(jpg|jpeg|png) or something similar.

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

ctx2011
thanks Ryan, but there is no regex like this in the htaccess (and the .htaccess file did not change during the update, I kept the old one). However, I did some more testing to understand what's going on. When I inspected the popup of image preview (JCE filebrowser) it tried to load the image with stripping the 2019-06- part, like domain.com/images/news/2019/07_July/20_Integrated_Holistic_Healthcare_Forum_House_of_Commons_London_-_award_ceremony.jpg?1565872233
The correct path would have been
domain.com/images/news/2019/07_July/2019-06-20_Integrated_Holistic_Healthcare_Forum_House_of_Commons_London_-_award_ceremony.jpg?1565872233
- when I try to open the image with path in browser - it is there.
- I renamed the image (stripping the date), moved it to the news directory, renamed it back to the original name - et voilá, it displayed the preview with no problem.
- Then I renamed another image in the same folder to start with a date (ie. to follow the same pattern) - it displayed with no problem, nothing was stripped.
- I created the same folder structure on another site with the same conditions (same server, PHP, Joomla version, JCE settings, etc.) - the same file caused no problem.
So I think this remains a mystery (there was one more file on this site that caused the same problem - out of nearly 3000).
Thanks again for looking at it, I do not think this is a JCE problem anyway.
Krisztina