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

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

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 1 Guest 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.