[fix] Put a & into a config var

This commit is contained in:
ljf (zamentur) 2023-02-06 14:28:06 +01:00 committed by GitHub
parent b7c5913683
commit 9f686a115f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -658,6 +658,7 @@ ynh_write_var_in_file() {
endline=${expression_with_comment#"$expression"} endline=${expression_with_comment#"$expression"}
endline="$(echo "$endline" | sed 's/\\/\\\\/g')" endline="$(echo "$endline" | sed 's/\\/\\\\/g')"
value="$(echo "$value" | sed 's/\\/\\\\/g')" value="$(echo "$value" | sed 's/\\/\\\\/g')"
value=${value//&/"\&"}
local first_char="${expression:0:1}" local first_char="${expression:0:1}"
delimiter=$'\001' delimiter=$'\001'
if [[ "$first_char" == '"' ]]; then if [[ "$first_char" == '"' ]]; then