Xinha image uploader changing filename - dashes to underscores
#1
Posted 07 October 2008 - 08:03 PM
#2
Posted 07 October 2008 - 09:55 PM
I just noticed that uploading images from within the Xinha editor renames images with dashes - making them underscores. Has anyone else noticed this? It's hard to believe I haven't run into this before...
never noticed, but yeah it does for me too... that could potentially make managing images confusing. I use the file manager, the Xinha image manager, and other software (dreamweaver, filezilla) to upload files so i'll have to keep a close eye on local vs remote image names.
thanks for bringing this up.
#3
Posted 07 October 2008 - 10:31 PM
#4
Posted 08 October 2008 - 01:20 PM
never noticed, but yeah it does for me too... that could potentially make managing images confusing. I use the file manager, the Xinha image manager, and other software (dreamweaver, filezilla) to upload files so i'll have to keep a close eye on local vs remote image names.
thanks for bringing this up.
Thanks for confirming this, Darren!
#5
Posted 08 October 2008 - 03:45 PM
line 86, xinha/plugins/ImageManager/Classes/Files.php
[codebox]/**
* Escape the filenames, any non-word characters will be
* replaced by an underscore.
* @param string $filename the orginal filename
* @return string the escaped safe filename
*/
function escape($filename)
{
Return preg_replace('/[^\w\._]/', '_', $filename);
}[/codebox]
#6
Posted 08 October 2008 - 03:57 PM
In here?
line 86, xinha/plugins/ImageManager/Classes/Files.php/** * Escape the filenames, any non-word characters will be * replaced by an underscore. * @param string $filename the orginal filename * @return string the escaped safe filename */ function escape($filename) { Return preg_replace('/[^\w\._]/', '_', $filename); }
That looks like it may be it, I don't know enough to decode that preg_replace line, Ralph, can you see a way to make that not change dashes to underscores?
#7
Posted 08 October 2008 - 04:25 PM
#8
Posted 08 October 2008 - 04:29 PM
Return preg_replace('/[^\w\._]/', '_', $filename);
the carrot "^" means "except"...
New
Return preg_replace('/[^\w\._-]/', '_', $filename);
But I'm not sure of the full consequences with the xinha code for doing this...
#9
Posted 08 October 2008 - 05:42 PM
#10
Posted 08 October 2008 - 06:49 PM
the carrot "^" means "except"...
well i learned something new today, time to turn in.
thanks Cris.
#11
Posted 08 October 2008 - 07:20 PM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











