From 8212010979977bff60a21a48232bd0294bee67ee Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Thu, 18 Jul 2019 18:16:46 +0200 Subject: [PATCH] Fix legit variable getting caught as an info to be redacted by the core --- data/helpers.d/utils | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/data/helpers.d/utils b/data/helpers.d/utils index a93fbf227..c9034ebc6 100644 --- a/data/helpers.d/utils +++ b/data/helpers.d/utils @@ -378,16 +378,18 @@ ynh_secure_remove () { ynh_get_plain_key() { local prefix="#" 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 while read line; do if [[ "$founded" == "1" ]] ; then [[ "$line" =~ ^${prefix}[^#] ]] && return echo $line - elif [[ "$line" =~ ^${prefix}${key}$ ]]; then + elif [[ "$line" =~ ^${prefix}${key_}$ ]]; then if [[ -n "${1:-}" ]]; then prefix+="#" - key=$1 + key_=$1 shift else founded=1