From f2ac59a1303f397e263404d10f1315977372b58e Mon Sep 17 00:00:00 2001 From: Michael Boelen Date: Wed, 18 Dec 2024 17:53:09 +0000 Subject: [PATCH] Allow forward slash in SafeInput check --- include/functions | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/functions b/include/functions index db7f5359..7f193aa5 100644 --- a/include/functions +++ b/include/functions @@ -3052,12 +3052,12 @@ SafeInput() { exitcode=1 - # By default remove only special or undefined characters + # Test against the string with a generic test set if [ $# -eq 1 ]; then input="$1" - # Allow only a common set of characters in first parameter - cleaned=$(echo "$input" | sed 's/[^a-zA-Z0-9\._:=-]//g') - # If know what to test against, then see if input matches the specified class + # Only allow common set of characters: a-z, A-Z, 0-9, /._-:= + cleaned=$(echo "$input" | sed 's/[^a-zA-Z0-9\/\._:=-]//g') + # If two parameters are specified, then test input against specified class elif [ $# -eq 2 ]; then input="$1" testchars="$2"