From: Jaroslav Kysela Date: Sat, 26 Dec 2015 16:35:40 +0000 (+0100) Subject: imagecache: deescape also file:// urls, fixes #3439 X-Git-Tag: v4.2.1~1278 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2fe7d02decd9597947dcbfe55aedec465684a8fd;p=thirdparty%2Ftvheadend.git imagecache: deescape also file:// urls, fixes #3439 --- diff --git a/src/imagecache.c b/src/imagecache.c index 3c6879ef3..f9a04faf2 100644 --- a/src/imagecache.c +++ b/src/imagecache.c @@ -16,6 +16,7 @@ * along with this program. If not, see . */ +#define _GNU_SOURCE #include #include #include @@ -637,6 +638,7 @@ int imagecache_open ( uint32_t id ) { imagecache_image_t skel, *i; + char *fn; int fd = -1; lock_assert(&global_lock); @@ -647,8 +649,11 @@ imagecache_open ( uint32_t id ) return -1; /* Local file */ - if (!strncasecmp(i->url, "file://", 7)) - fd = open(i->url + 7, O_RDONLY); + if (!strncasecmp(i->url, "file://", 7)) { + fn = strdupa(i->url + 7); + http_deescape(fn); + fd = open(fn, O_RDONLY); + } /* Remote file */ #if ENABLE_IMAGECACHE