[Libreoffice-commits] core.git: 3 commits - shell/source
Stephan Bergmann
sbergman at redhat.com
Thu Oct 17 01:23:54 PDT 2013
shell/source/unix/misc/open-url.sh | 24 +++++-------------------
1 file changed, 5 insertions(+), 19 deletions(-)
New commits:
commit fcdde111e451f84e373c67a485c87d1ad744cfe4
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Thu Oct 17 10:17:22 2013 +0200
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
diff --git a/shell/source/unix/misc/open-url.sh b/shell/source/unix/misc/open-url.sh
index cbad78d..98a4d3f 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" &
commit 7ff0a2e41c872dbfacf132ff756ed10dc8f3e8c7
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Thu Oct 17 10:04:28 2013 +0200
Quoting clean-up
cosmetics only; even the unquoted echo $1 would not have caused any problems
Change-Id: Iabae872fe6232dc1cd627b736f0c4fc5a8611037
diff --git a/shell/source/unix/misc/open-url.sh b/shell/source/unix/misc/open-url.sh
index 4b1d6d4..cbad78d 100755
--- a/shell/source/unix/misc/open-url.sh
+++ b/shell/source/unix/misc/open-url.sh
@@ -33,7 +33,7 @@ which() {
# checks for the original mozilla start script(s)
# and restrict the "-remote" semantics to those.
run_mozilla() {
- if file "$1" | grep "script" > /dev/null && grep "NPL" "$1" > /dev/null; then
+ if file "$1" | grep script > /dev/null && grep NPL "$1" > /dev/null; then
"$1" -remote 'ping()' 2>/dev/null >/dev/null
if [ $? -eq 2 ]; then
"$1" "$2" &
@@ -46,7 +46,7 @@ run_mozilla() {
}
# special handling for mailto: uris
-if echo $1 | grep '^mailto:' > /dev/null; then
+if echo "$1" | grep '^mailto:' > /dev/null; then
# check for xdg-email
mailer=`which xdg-email`
if [ ! -z "$mailer" ]; then
commit 288d1a3ff4a5b2b96b278c791c52376d2c3c980b
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Thu Oct 17 10:00:14 2013 +0200
Remove unused run_browser()
...unused right from the start in 3d5468a8590ff9b36ac16845782af118d07b7786
"INTEGRATION: CWS defaultbrowser: #i27120# new unix shell execute service
implementation."
Change-Id: I18ae3c4c372163787e9bd4f8c946e15128a9deeb
diff --git a/shell/source/unix/misc/open-url.sh b/shell/source/unix/misc/open-url.sh
index ff92375..4b1d6d4 100755
--- a/shell/source/unix/misc/open-url.sh
+++ b/shell/source/unix/misc/open-url.sh
@@ -45,22 +45,6 @@ run_mozilla() {
fi
}
-# checks the browser value for a %s as defined in
-# http://www.catb.org/~esr/BROWSER/index.html
-run_browser() {
- echo "$1|$2" | awk '
-{
- FS="|";
- $syscmd="";
- if (index($1,"%s") > 0) {
- $syscmd=sprintf($1,$2);
- } else {
- $syscmd=sprintf("%s \"%s\"",$1,$2);
- }
- system($syscmd " &");
-}' > /dev/null
-}
-
# special handling for mailto: uris
if echo $1 | grep '^mailto:' > /dev/null; then
# check for xdg-email
More information about the Libreoffice-commits
mailing list