X-Git-Url: http://git.plutz.net/?a=blobdiff_plain;f=action.sh;h=f8faf1f6a8001fdabf9a414ed7e5190b86197f4f;hb=3a43bceff672dae6d391a53a1a12943c207aeff1;hp=390c5ef616d0217385892ca34a7ed952ebed5170;hpb=fa5c15e6e36107359d926ece94df2b614f37a37b;p=cgilite diff --git a/action.sh b/action.sh index 390c5ef..f8faf1f 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 +