X-Git-Url: http://git.plutz.net/?p=cgilite;a=blobdiff_plain;f=action.sh;h=caf214c410310da54f6befbe5f95cd6cfa711cf1;hp=5432664b288da1116d90a2ec349642e0a4a1c7ad;hb=397e40b92e591ae9066dcabb414d8097555beea8;hpb=49831f4301899b008b94f590b4c9765f76b4c0f0 diff --git a/action.sh b/action.sh index 5432664..caf214c 100755 --- a/action.sh +++ b/action.sh @@ -17,8 +17,14 @@ # You should have received a copy of the GNU Affero General Public License # along with Serve0. If not, see . -ACTION="$(echo "$_GET[\"action\"]" |egrep '^[a-zA-Z0-9_-]+$')" +ACTION="$(printf %s "${_GET[action]}" |egrep '^[a-zA-Z0-9_-]+$')" ACTION="${_EXEC}/actions/${ACTION}.sh" -[ -x "$ACTION" ] || echo -n "Location: ?p=error\n\n" -. $ACTION +if [ -x "$ACTION" ]; then + debug "trying to execute $ACTION" + . $ACTION +else + debug "unable to execute $ACTION" + printf "Location: ?p=error\n\n" +fi +