Merge pull request #59 from bifek/fix10

"/" in the uri must never be urlencoded
This commit is contained in:
Tom.C. 2014-11-23 10:00:44 +01:00
commit b25e162597

View file

@ -289,40 +289,26 @@ $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");
$imgParams = http_build_query(
array(
'filename' => "$thumbdir/$file",
'size' => $thumb_size
),
'',
'&'
);
$imgUrl = GALLERY_ROOT . "createthumb.php?$imgParams";
if ($lazyload) {
$linkUrl = urlencode("$currentdir/$file");
$imgParams = http_build_query(
array(
'filename' => "$thumbdir/$file",
'size' => $thumb_size
),
'',
'&'
);
$imgUrl = GALLERY_ROOT . "createthumb.php?$imgParams";
$files[] = array (
"name" => $file,
"date" => filemtime($currentdir . "/" . $file),
"size" => filesize($currentdir . "/" . $file),
"html" => "<li><a href={$linkUrl} rel='lightbox[billeder]' title=\"".htmlentities($img_captions[$file])."\"><img class=\"b-lazy\" src=data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw== data-src=\"$imgUrl\" alt='$label_loading' /></a>" . $filename_caption . "</li>");
$imgopts = "class=\"b-lazy\" src=data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw== data-src=\"$imgUrl\"";
} else {
$linkUrl = urlencode("$currentdir/$file");
$imgParams = http_build_query(
array(
'filename' => "$thumbdir/$file",
'size' => $thumb_size
),
'',
'&amp;'
);
$imgUrl = GALLERY_ROOT . "createthumb.php?$imgParams";
$imgopts = "src=\"{$imgUrl}\"";
}
$files[] = array (
"name" => $file,
"date" => filemtime($currentdir . "/" . $file),
"size" => filesize($currentdir . "/" . $file),
"html" => "<li><a href=\"{$linkUrl}\" rel='lightbox[billeder]' title=\"".htmlentities($img_captions[$file])."\"><img src=\"{$imgUrl}\" alt='$label_loading' /></a>" . $filename_caption . "</li>"); }
"html" => "<li><a href=\"{$linkUrl}\" rel='lightbox[billeder]' title=\"".htmlentities($img_captions[$file])."\"><img $imgopts alt='$label_loading' /></a>" . $filename_caption . "</li>");
}
// Other filetypes
$extension = "";