Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: Enable special char and disable "_" replacement in filenames  (Read 2221 times)

0 Members and 1 Guest are viewing this topic.

RubySN4

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Enable special char and disable "_" replacement in filenames
« 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
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Enable special char and disable "_" replacement in filenames
« Reply #1 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.
Logged

RubySN4

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: Enable special char and disable "_" replacement in filenames
« Reply #2 on: August 16, 2012, 03:32:15 pm »

Thank you so much! :D
Logged
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 19 queries.