From: Shaun M. <sh...@ae...> - 2006-02-17 13:52:20
|
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. Shaun aegis design - http://www.aegisdesign.co.uk aegis hosting - http://www.aegishosting.co.uk |