forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 miscellaneous => Topic started by: RubySN4 on August 16, 2012, 02:49:35 pm

Title: Enable special char and disable "_" replacement in filenames
Post by: RubySN4 on August 16, 2012, 02:49:35 pm
Hello,

I've had a problem with filenames since I've upgraded to cpg 1.5, and I would really like to get it fix if possible. I have files named this way: Vancouver Food Truck Festival (Vancouver) - 29 July 2012.jpg and it used to be fine with cpg 1.4 but now if I upload a file with a similar name it transforms it to: Vancouver20Food20Truck20Festival2028Vancouver2920-202920July202012.jpg. Is there a way to allow these "(), ' ' " back in the filenames?

FYI: these are the characters that aren't allowed in my settings: $/\\:*?"'<>|`&#@

I know that this question has been asked several times but I couldn't find a solution this time.

Thanks in advance for the help you can provide.

Stephanie
Title: Re: Enable special char and disable "_" replacement in filenames
Post by: Αndré on August 16, 2012, 03:05:24 pm
Open include/functions.inc.php, find
Code: [Select]
    $condition = array (
        'transliteration' => true,
        'special_chars' => true
    );
and replace with
Code: [Select]
    $condition = array (
        'transliteration' => true,
        'special_chars' => false
    );

Mind, that it only affects newly uploaded files. If it works as expected you can use the plugin hook replace_forbidden_conditions to adjust the above array, so you don't need to apply that change after each Coppermine update.
Title: Re: Enable special char and disable "_" replacement in filenames
Post by: RubySN4 on August 16, 2012, 03:32:15 pm
Thank you so much! :D