I’m building a filebrowser in PHP by using URL Parameters and I’m having problems with some special chars.
I managed to translate ß into %26 and ' into %2C and as expected my R’n’B folder outputs R%2Cn%2CB as but PHP says
Warning: opendir(dir//Musik/R,n,B/,dir//Musik/R,n,B/) [function.opendir]: Das System kann die angegebene Datei nicht finden. (code: 2)
My code snippet:
function fileBrowser($dir, $file) {
$trans = array("&" => "%26","'" => "%2C");
$cdir = strtr(@$_GET['dir'],$trans);
$cfile = strtr($file,$trans);
...
Can you please give me a hint?
I will suggest to use urlencode/urldecode instead replace it by your self.
However
ßis%C3%9Fand'is%27