58 lines
1.9 KiB
Diff
58 lines
1.9 KiB
Diff
--- xdg-utils-1.1.3/scripts/xdg-open.in 2018-05-10 18:02:31.000000000 +0300
|
|
+++ xdg-utils_1.1.3/scripts/xdg-open.in 2020-03-30 22:00:36.036439372 +0300
|
|
@@ -366,13 +366,9 @@
|
|
fi
|
|
}
|
|
|
|
-has_single_argument()
|
|
-{
|
|
- test $# = 1
|
|
-}
|
|
-
|
|
open_envvar()
|
|
{
|
|
+ local url="$1"
|
|
local oldifs="$IFS"
|
|
local browser browser_with_arg
|
|
|
|
@@ -385,12 +381,15 @@
|
|
fi
|
|
|
|
if echo "$browser" | grep -q %s; then
|
|
- # Avoid argument injection.
|
|
+ # Use loop to insert URL for avoid argument injection.
|
|
# See https://bugs.freedesktop.org/show_bug.cgi?id=103807
|
|
- # URIs don't have IFS characters spaces anyway.
|
|
- has_single_argument $1 && $(printf "$browser" "$1")
|
|
+ shift $#
|
|
+ for arg in $browser; do
|
|
+ set -- "$@" "$(printf -- "$arg" "$url")"
|
|
+ done
|
|
+
|
|
else
|
|
- $browser "$1"
|
|
+ $browser "$url"
|
|
fi
|
|
|
|
if [ $? -eq 0 ]; then
|
|
--- xdg-utils-1.1.3/scripts/xdg-email.in 2018-05-10 18:02:31.000000000 +0300
|
|
+++ xdg-utils_1.1.3/scripts/xdg-email.in 2020-03-30 22:00:36.064439373 +0300
|
|
@@ -91,13 +91,13 @@
|
|
fi
|
|
|
|
if which $kreadconfig >/dev/null 2>&1; then
|
|
- local profile=$($kreadconfig --file emaildefaults \
|
|
- --group Defaults --key Profile)
|
|
+ local profile="$($kreadconfig --file emaildefaults \
|
|
+ --group Defaults --key Profile)"
|
|
if [ -n "$profile" ]; then
|
|
- local client=$($kreadconfig --file emaildefaults \
|
|
+ local client="$($kreadconfig --file emaildefaults \
|
|
--group "PROFILE_$profile" \
|
|
--key EmailClient \
|
|
- | cut -d ' ' -f 1)
|
|
+ | cut -d ' ' -f 1)"
|
|
|
|
if echo "$client" | grep -Eq 'thunderbird|icedove'; then
|
|
run_thunderbird "$client" "$1"
|