File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -16,17 +16,17 @@ tokenize_command() {
1616check_allowed_commands () {
1717 local cmd=" ${TOKENS[0]} "
1818 for allowed in " ${ALLOWED_COMMANDS[@]} " ; do
19- [[ " $cmd " == " $allowed " ]] && return 0
19+ [[ " ${ cmd} " == " ${ allowed} " ]] && return 0
2020 done
2121
22- echo >&2 " ERROR: refusing to run arbitrary command: $cmd "
22+ echo >&2 " ERROR: refusing to run arbitrary command: ${ cmd} "
2323 exit 1
2424}
2525
2626validate_tokens () {
2727 for token in " ${TOKENS[@]} " ; do
28- if [[ " $token " =~ [\;\|\&\$\<\>\`\\ ] ]]; then
29- echo >&2 " ERROR: refusing unsafe token: $token "
28+ if [[ " ${ token} " =~ [\;\|\&\$\<\>\`\\ ] ]]; then
29+ echo >&2 " ERROR: refusing unsafe token: ${ token} "
3030 exit 1
3131 fi
3232 done
@@ -62,7 +62,8 @@ grep -lrF "${MARKER_START}" _wiki | while read -r file_to_process; do
6262 USER_COMMAND=" ${line## " ${MARKER_START} " } "
6363 USER_COMMAND=" ${USER_COMMAND%% " ${MARKER_END} " } "
6464
65- execute_command " $USER_COMMAND " < /dev/null || true
65+ # shellcheck disable=SC2310
66+ execute_command " ${USER_COMMAND} " < /dev/null || true
6667 else
6768 echo " ${line} "
6869 fi
You can’t perform that action at this time.
0 commit comments