On selecting Filename => Title, allow chars ( ) , On selecting Filename => Title, allow chars ( ) ,
 

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

Main Menu

On selecting Filename => Title, allow chars ( ) ,

Started by fdcusa, February 08, 2015, 10:25:47 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

fdcusa

My filenames have parens, commas, and underlines in them.  After uploading files, the filename => Title option under Admin Tools gratiously copies the filename to the Title; however, it replaces ( with "28", ) with "29", and comma with "2C" (and underline to space).  I presume that is the hex ascii code.

Is it possible to modify the code allow parens and commas to pass through without change?

Αndré

Please re-check your file names after you've added them to your Coppermine gallery. Some time ago we decided to replace almost all non-alphanumerical characters in file names, for compatibility reasons:
Code (include/functions.inc.php) Select
    $condition = array (
        'transliteration' => true,
        'special_chars' => true
    );
    $condition = CPGPluginAPI::filter('replace_forbidden_conditions', $condition);

    /**
     * Transliteration
     */
    if ($condition['transliteration']) {
        require_once('include/transliteration.inc.php');
        $return = transliteration_process($return, '_');
    }

    /**
     * Replace special chars
     */
    if ($condition['special_chars']) {
        $return = str_replace('%', '', rawurlencode($return));
    }


That's maybe too much for some people in some cases, so we added a plugin hook to disable either one or both methods.


I assume the "filename => title" feature works as expected, as the characters have already replaced in your file names. You maybe want to set $condition['special_chars'] to false for future file uploads.

fdcusa

Thank you, Αndré!   :)

Until I understand the code better I have disabled 'special_chars' as you suggested and no conversion is done. 

Yes, "filename => title" is working as advertised.