qvm-open-in-vm: escape URL when wrapping it in HTML
Thanks @v6ak for the report and solution. Fixes QubesOS/qubes-issues#1462
This commit is contained in:
parent
817606a09d
commit
ff2678d2f5
@ -6,9 +6,10 @@ wrap_in_html_if_url()
|
||||
*://*)
|
||||
FILE_ARGUMENT=$(mktemp)
|
||||
|
||||
echo -n '<html><meta HTTP-EQUIV="REFRESH" content="0; url=' > $FILE_ARGUMENT
|
||||
echo -n "$1" >> $FILE_ARGUMENT
|
||||
echo '"></html>' >> $FILE_ARGUMENT
|
||||
echo -n '<html><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>'
|
||||
echo -n '<meta HTTP-EQUIV="REFRESH" content="0; url=' > $FILE_ARGUMENT
|
||||
echo -n "$1" | sed 's/&/\&/g; s/</\</g; s/>/\>/g; s/"/\"/g; s/'"'"'/\'/g' >> $FILE_ARGUMENT
|
||||
echo '"/></html>' >> $FILE_ARGUMENT
|
||||
;;
|
||||
*)
|
||||
FILE_ARGUMENT="$1"
|
||||
|
Loading…
Reference in New Issue
Block a user