mirror of
https://github.com/m8tin/cis.git
synced 2026-06-02 14:56:58 +02:00
Fix to allow absolute paths as parameter
This commit is contained in:
+3
-3
@@ -20,9 +20,9 @@ function base.checkAllInputParameters() {
|
||||
_SUCCESS="true"
|
||||
for _ARG in "${@}"; do
|
||||
if [[ -n "${_ARG}" ]]; then
|
||||
# Has to start with an alphanumeric char or --
|
||||
if [[ ! "${_ARG}" =~ ^[[:alnum:]] ]] && [[ ! "${_ARG}" =~ ^--[[:alnum:]] ]]; then
|
||||
echo "❌ Security base.checkAllInputParameters(): No special character is allowed at the beginning of the parameter: '${_ARG}'" >&2
|
||||
# Has to start with an alphanumeric char '--' or '/'
|
||||
if [[ ! "${_ARG}" =~ ^(--|/)?[[:alnum:]] ]]; then
|
||||
echo "❌ Security base.checkAllInputParameters(): No special characters except '--' or '/' are allowed at the beginning of a parameter: '${_ARG}'" >&2
|
||||
_SUCCESS="false"
|
||||
fi
|
||||
# No forbidden character is allowed to remain
|
||||
|
||||
Reference in New Issue
Block a user