From bad9c8855f5ea114865440e474baf1b6e04f44d5 Mon Sep 17 00:00:00 2001 From: David Costa Date: Tue, 24 Jun 2014 22:02:04 +0200 Subject: [PATCH] xdg-open: fixes #63153 decoding the URL --- scripts/xdg-open.in | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/xdg-open.in b/scripts/xdg-open.in index 637a762..73833c1 100644 --- a/scripts/xdg-open.in +++ b/scripts/xdg-open.in @@ -306,7 +306,13 @@ open_lxde() if (echo "$1" | grep -q '^file://' || ! echo "$1" | egrep -q '^[[:alpha:]+\.\-]+:') then - local file="$(echo "$1" | sed 's%^file://%%')" + local file="$1" + + # Decode URLs + if echo "$file" | grep -q '^file:///'; then + file=${file#file://} + file="$(printf "$(echo "$file" | sed -e 's@%\([a-f0-9A-F]\{2\}\)@\\x\1@g')")" + fi # handle relative paths if ! echo "$file" | grep -q '^/'; then -- 2.0.0