diff --git a/index.php b/index.php index 9ab5c6c..8ee577b 100644 --- a/index.php +++ b/index.php @@ -289,7 +289,7 @@ $dirs = array(); if (is_file($currentdir.'/'.$file.'.html')) { $img_captions[$file] = $file.'::'.htmlspecialchars(file_get_contents($currentdir.'/'.$file.'.html'),ENT_QUOTES); } - $linkUrl = rawurlencode("$currentdir/$file"); + $linkUrl = join("/", array_merge(array_map(rawurlencode, split("/", $currentdir)), array(rawurlencode($file)))); $imgParams = http_build_query( array( 'filename' => "$thumbdir/$file",