Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
KCFinder Plugin for GetSimple 3.x
#12
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:
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


GS Community Edition with php8.x compatibility, new features and much more!  Support Me


Reply


Messages In This Thread
KCFinder Plugin for GetSimple 3.x - by n00dles101 - 2012-10-24, 00:54:22
RE: KCFinder Plugin for GetSimple 3.x - by morvy - 2012-11-01, 04:53:54
RE: KCFinder Plugin for GetSimple 3.x - by islander - 2012-11-12, 21:35:14
KCFinder Plugin for GetSimple 3.x - by Carlos - 2012-10-24, 04:30:08
KCFinder Plugin for GetSimple 3.x - by n00dles101 - 2012-10-24, 04:35:10
KCFinder Plugin for GetSimple 3.x - by islander - 2012-10-25, 18:54:54
KCFinder Plugin for GetSimple 3.x - by n00dles101 - 2012-10-25, 19:12:15
KCFinder Plugin for GetSimple 3.x - by Oleg06 - 2012-10-26, 00:30:23
KCFinder Plugin for GetSimple 3.x - by n00dles101 - 2012-10-26, 01:17:35
KCFinder Plugin for GetSimple 3.x - by islander - 2012-10-29, 02:58:39



Users browsing this thread: 1 Guest(s)