From 2f0905a30460f44aa8bafc670deaf0ee6211b0d5 Mon Sep 17 00:00:00 2001 From: Lucas Cimon Date: Mon, 24 Nov 2014 18:33:26 +0100 Subject: [PATCH] Do not escape slashes in images href URLs Fixes #57 --- index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.php b/index.php index 25e0ec8..85a505e 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",