Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
imagecache: deescape also file:// urls, fixes #3439
  • Loading branch information
perexg committed Dec 26, 2015
1 parent c62bcc6 commit 2fe7d02
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/imagecache.c
Expand Up @@ -16,6 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#define _GNU_SOURCE
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
Expand Down Expand Up @@ -637,6 +638,7 @@ int
imagecache_open ( uint32_t id )
{
imagecache_image_t skel, *i;
char *fn;
int fd = -1;

lock_assert(&global_lock);
Expand All @@ -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
Expand Down

0 comments on commit 2fe7d02

Please sign in to comment.