From 0f7743992b1816ba0bddffe4c7c122469c47e32b Mon Sep 17 00:00:00 2001 From: hallgren Date: Mon, 25 Jul 2011 19:21:46 +0000 Subject: gfse: various small improvements --- src/editor/simple/upload.cgi | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src/editor/simple/upload.cgi') diff --git a/src/editor/simple/upload.cgi b/src/editor/simple/upload.cgi index 18d584b54..3da386dd6 100644 --- a/src/editor/simple/upload.cgi +++ b/src/editor/simple/upload.cgi @@ -162,11 +162,17 @@ case "$REQUEST_METHOD" in if [ -d "$path" ] ; then ContentType="text/plain; charset=$charset" cgiheaders - cd "$path" - shopt -s nullglob - rm *.gf *.gfo *-*.json *.pgf grammars.cgi - cd .. - rmdir "$path" + if [ -h "$path" ] ; then + cd "$path" + cd .. + rm "$path" + else + cd "$path" + shopt -s nullglob + rm *.gf *.gfo *-*.json *.pgf grammars.cgi + cd .. + rmdir "$path" + fi newdir=$(qparse "$QUERY_STRING" newdir) case "$newdir" in /tmp/gfse.*) # shouldn't allow .. in path !!! -- cgit v1.2.3