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,41 +289,27 @@ $dirs = array();
if (is_file($currentdir.'/'.$file.'.html')) { if (is_file($currentdir.'/'.$file.'.html')) {
$img_captions[$file] = $file.'::'.htmlspecialchars(file_get_contents($currentdir.'/'.$file.'.html'),ENT_QUOTES); $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) { if ($lazyload) {
$linkUrl = urlencode("$currentdir/$file"); $imgopts = "class=\"b-lazy\" src=data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw== data-src=\"$imgUrl\"";
$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>");
} else { } else {
$linkUrl = urlencode("$currentdir/$file"); $imgopts = "src=\"{$imgUrl}\"";
$imgParams = http_build_query( }
array( $files[] = array (
'filename' => "$thumbdir/$file", "name" => $file,
'size' => $thumb_size
),
'',
'&amp;'
);
$imgUrl = GALLERY_ROOT . "createthumb.php?$imgParams";
$files[] = array (
"name" => $file,
"date" => filemtime($currentdir . "/" . $file), "date" => filemtime($currentdir . "/" . $file),
"size" => filesize($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 // Other filetypes
$extension = ""; $extension = "";
if (preg_match("/.pdf$/i", $file)) $extension = "PDF"; // PDF if (preg_match("/.pdf$/i", $file)) $extension = "PDF"; // PDF