Fix legit variable getting caught as an info to be redacted by the core

This commit is contained in:
Alexandre Aubin 2019-07-18 18:16:46 +02:00
parent 46310dbb6c
commit 7e99541064

View file

@ -378,16 +378,18 @@ ynh_secure_remove () {
ynh_get_plain_key() { ynh_get_plain_key() {
local prefix="#" local prefix="#"
local founded=0 local founded=0
local key=$1 # We call this key_ so that it's not caught as
# an info to be redacted by the core
local key_=$1
shift shift
while read line; do while read line; do
if [[ "$founded" == "1" ]] ; then if [[ "$founded" == "1" ]] ; then
[[ "$line" =~ ^${prefix}[^#] ]] && return [[ "$line" =~ ^${prefix}[^#] ]] && return
echo $line echo $line
elif [[ "$line" =~ ^${prefix}${key}$ ]]; then elif [[ "$line" =~ ^${prefix}${key_}$ ]]; then
if [[ -n "${1:-}" ]]; then if [[ -n "${1:-}" ]]; then
prefix+="#" prefix+="#"
key=$1 key_=$1
shift shift
else else
founded=1 founded=1