2012-11-12, 21:35:14
I had a small problem with users uploading files with foreign characters (á,ÃÂ,ñ, etc.) in the name, which would cause problems using these files.
To fix this, I changed the following in "plugins/kcfinder/core/browser.php"...
Line 267 from:
to:
Alternatively, you could use the following to preplace all foreign characters with an "_":
To fix this, I changed the following in "plugins/kcfinder/core/browser.php"...
Line 267 from:
Code:
'name' => $name,
to:
Code:
//'name' => $name,
$SpecialChars = array("á", "é", "ÃÂ", "ó", "ú", "ÃÂ", "É", "ÃÂ", "Ó", "Ú", "ñ", "Ñ", " "),
$ReplacementChars = array("a", "e", "i", "o", "u", "A", "E", "I", "O", "U", "n", "N", "_"),
'name' => str_replace($SpecialChars, $ReplacementChars, $name),
Alternatively, you could use the following to preplace all foreign characters with an "_":
Code:
//'name' => $name,
'name' => preg_replace('/[^A-Za-z0-9\.]/', '_', $name), // replaces all foreign characters with underscore