diff options
| author | hallgren <hallgren@chalmers.se> | 2011-07-25 19:21:46 +0000 |
|---|---|---|
| committer | hallgren <hallgren@chalmers.se> | 2011-07-25 19:21:46 +0000 |
| commit | 0f7743992b1816ba0bddffe4c7c122469c47e32b (patch) | |
| tree | d3767ea812ebc5d142f1ec03a177d91978e704e1 /src/editor/simple/upload.cgi | |
| parent | 848373e29e6d16db50b68e8835a474dd14b5ab9d (diff) | |
gfse: various small improvements
Diffstat (limited to 'src/editor/simple/upload.cgi')
| -rw-r--r-- | src/editor/simple/upload.cgi | 16 |
1 files changed, 11 insertions, 5 deletions
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 !!! |
