Tighten the regex in Issue 6 bugfix.

Checks for complete action names before escaping &'s
This commit is contained in:
Paul Mansfield
2009-09-05 23:55:22 +01:00
parent ddaf9ade22
commit 51dd50b41d

View File

@@ -248,7 +248,7 @@ cleaninput()
input=`echo $input | tr -d '\r|\n'`
# Check which action we are being used in as this affects what cleaning we do
if [[ $action =~ (append|app|prepend|prep|replace) ]]; then
if [[ $action =~ ^(append|app|prepend|prep|replace)$ ]]; then
# These actions use sed and & as the matched string so escape it
input=`echo $input | sed 's/\&/\\\&/g'`
fi