[pmwiki-users] MakeUploadNamePatterns surprise

Carles Escrig Royo esroyo at gmail.com
Tue Jun 17 04:51:15 CDT 2014

Hi all,

I used to have the $MakeUploadNamePatterns defined as:

$UploadNameChars = "-\\w. ";
$MakeUploadNamePatterns = array(
    "/[^$UploadNameChars]/" => '',
    '/\\.[^.]*$/e' => 'strtolower("$0")',
    '/^[^[:alnum:]_]+/' => '',
    '/[^[:alnum:]_]+$/' => '',
    '/\\s/' => '_');

Note it only differs with default on the space-underscore substitution.

I just upgraded php and all other software in the server, and to my
surprise filenames are not sanitized as expected any more. Lots of files
are not recognized because their sanitized name is different :(

The reason is that "_" is now a callable function of php:


(Or, may be I didn't have the gettext extension enabled before)

Anyway, do you think It's possible to bypass the problem without
modifying scripts/upload.php?



More information about the pmwiki-users mailing list