diff --git a/homepage/redesign2018/markdownExperiment/phpLib/imgGallery/index.php.tmpl b/homepage/redesign2018/markdownExperiment/phpLib/imgGallery/index.php.tmpl index f637c54..99f153c 100644 --- a/homepage/redesign2018/markdownExperiment/phpLib/imgGallery/index.php.tmpl +++ b/homepage/redesign2018/markdownExperiment/phpLib/imgGallery/index.php.tmpl @@ -8,6 +8,13 @@ require_once($basePath."/ressourcen/phpLib/phpcount/phpcount.php"); +function myUrlEncode($string) { + $entities = array( '%21', '%2A', '%27', '%28', '%29', '%3B', '%3A', '%40', '%26', '%3D', '%2B', '%24', '%2C', '%2F', '%3F', '%25', '%23', '%5B', '%5D'); + $replacements = array( '!', '*', "'", "(", ")", ";", ":", "@", "&", "=", "+", "$", ",", "/", "?", "%", "#", "[", "]"); + //return str_replace($entities, $replacements, urlencode($string)); + return str_replace($entities, $replacements, rawurlencode($string)); +} + function startsWith($haystack, $needle){ $length = strlen($needle); return (substr($haystack, 0, $length) === $needle); @@ -54,6 +61,19 @@ return $retVal; $messages = array(); $galleryId = "0"; $pickedImages = array(); + + // Wie es scheint ist sind die Dateinamen auf bplaced in "ISO-8859-1" + array_walk( + $imgList, + function (&$value, $key) { + $value = iconv( "UTF-8", "ISO-8859-1",$value); + //$value = urlencode($value); + //$value = urlencode($value); + //$value = myUrlEncode($value); + //$value=implode('/', array_map('rawurlencode', explode('/', $value))); + $value=implode('/', array_map('myUrlEncode', explode('/', $value))); + }); + // echo("imgList: "); print_r($imgList); // foreach($imgList as $img){