From eccaf81eef4c1528875503aa0cdbea130d755c5a Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Tue, 14 Aug 2018 02:51:14 +0200 Subject: [PATCH] foto: keep data subdirectory in thumb paths Support non-numeric roots broken since commit v3.1-4-g1c59746cd8 (2018-06-16) [thumb: prefix data path only for numeric roots]. --- foto/index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/foto/index.php b/foto/index.php index eadda91..f77b9c1 100644 --- a/foto/index.php +++ b/foto/index.php @@ -34,7 +34,7 @@ function showthumb($path) { // assume all album entries are symlinks to archive originals $target = preg_replace('{^(\.\./)*}', '', readlink($path)); - $thumb = preg_replace('{^data/}', 'thumb/200/', $target); + $thumb = 'thumb/200/' . $target; @list ($order, $size, $title) = explode(':', pathinfo($path, PATHINFO_FILENAME), 3); $imgtag = 'img src="/'.$thumb.'"'; @@ -57,7 +57,7 @@ if ($imgs = glob("$rootdir/*", GLOB_ONLYDIR)) { $cover = "$path/index.jpg"; if (!file_exists($cover)) $cover = 'foto/index.jpg'; if (is_link($cover)) { - $cover = preg_replace('{^(?:\.\./)*data/}', 'thumb/100/', readlink($cover)); + $cover = preg_replace('{^(?:\.\./)*(?=data/)}', 'thumb/100/', readlink($cover)); } $html = ''; -- 2.30.0