From: Verdon V. <ve...@ve...> - 2006-02-17 14:22:38
|
On 17-Feb-06, at 8:52 AM, Shaun Murray wrote: > > On 17 Feb 2006, at 13:42, Verdon Vaillancourt wrote: >> >> When EZform::saveImage() is used in conjunction with >> PHPWS_File::makeThumbnail() to resize the original image and >> overwrite it on upload -- as is used in a couple of my modules, as >> well as my already committed patch to Announcements, and possibly >> others -- there can be an unexpected result if the image being >> uploaded has an uppercase extension. This happens because >> EZform::saveImage() essentially leaves the filename alone while >> PHPWS_File::makeThumbnail() converts the extension to lowercase. The >> end result is that 'Image.JPG' gets passed to the image data array >> that is saved to the db, while the actual final resized image on the >> server is named 'Image.jpg', leading to problems on a case-sensitive >> filesystem. >> >> My suggestion would be to do something like have EZform::saveImage() >> convert filenames to lowercase, or some such thing, and I'm willing >> to do it. I just have been too busy and haven't had much time to do >> more than a cursory evaluation of the cause/effect. > > There was a similar issue with photoalbum a while back which would let > through filenames with illegal characters for the file system. eg. on > a Mac you can pretty much have anything including quotes, > international characters and spaces but not so on Linux. I added in a > function to convert the filename to a safe filename based on some code > from php.net. Maybe have a look at that and see if it could be > expanded. > Ya, I was glancing at that filename to safe bit, and thinking along those lines too. I am mighty busy, so don't wait for me if you want to go, but I will try to have a look at EZform::saveImage() this weekend and see if it can't be tweaked a bit. verdon |