summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2013-10-17 10:17:22 +0200
committerStephan Bergmann <sbergman@redhat.com>2013-10-17 10:23:33 +0200
commitfcdde111e451f84e373c67a485c87d1ad744cfe4 (patch)
tree6e86cd7b6cc8b5026fa93ece4cadc71cd8f8b362 /shell
parent7ff0a2e41c872dbfacf132ff756ed10dc8f3e8c7 (diff)
fdo#69462 Properly escape URL in Mozilla -remote openURL(...) command
Verbatim ")" or "," in the URL will apparently cause problems when Mozilla- derived browsers parse the openURL(...) command (see <http://www-archive.mozilla.org/unix/remote.html> "remote control of unix mozilla"), so percent-escape all "(", ")", and "," in the URL. Also, remove the space before "new-window" as "Commands should /not/ have spaces in them" (see link above). Change-Id: I4b0f3f6a19c94ed9346bb6c55e77d6eae82baba2
Diffstat (limited to 'shell')
-rwxr-xr-xshell/source/unix/misc/open-url.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/shell/source/unix/misc/open-url.sh b/shell/source/unix/misc/open-url.sh
index cbad78dbe5dc..98a4d3fe00bc 100755
--- a/shell/source/unix/misc/open-url.sh
+++ b/shell/source/unix/misc/open-url.sh
@@ -38,7 +38,9 @@ run_mozilla() {
if [ $? -eq 2 ]; then
"$1" "$2" &
else
- "$1" -remote "openURL($2, new-window)" &
+ "$1" -remote \
+ "openURL($(printf '%s' "$2" \
+ | sed -e 's/(/%28/g' -e 's/)/%29/g' -e 's/,/%2C/g'),new-window)" &
fi
else
"$1" "$2" &