Skip to content

Commit

Permalink
v4.1.1: bug fix: form fields after a file upload field were ignored. …
Browse files Browse the repository at this point in the history
…Please upgrade!

  Bug report by "pipoprods", issue #7.
  • Loading branch information
ColasNahaboo committed Nov 24, 2022
1 parent 3864380 commit 14e2dfa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ Feel welcome to copy and enhance this project, as well as providing bug reports,
- Or just email me: [email protected]

## History of changes
- 2021-12-23 v4.1.0
- 2022-11-24 v4.1.1: bug fix: form fields after a file upload field were ignored. Please upgrade!
Bug report by "pipoprods", issue #7.
- 2021-12-23 v4.1.0:
- switched to semantic versioning, with new var `CGIBASHOPTS_RELEASE`
- new -d option to specify the temporary directory (suggestion of "Aufschlauer")
- move to GitHub: moved most files out of the main view, in tests/, tewiba upgraded to 1.5.0, code cleanup up to pass shellcheck
Expand Down
7 changes: 4 additions & 3 deletions cgibashopts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# See https://github.com/ColasNahaboo/cgibashopts
# Uses the CGI env variables REQUEST_METHOD CONTENT_TYPE QUERY_STRING

export CGIBASHOPTS_RELEASE=4.1.0
export CGIBASHOPTS_RELEASE=4.1.1
export CGIBASHOPTS_VERSION="${CGIBASHOPTS_RELEASE%%.*}"
cr=$'\r'
nl=$'\n'
Expand Down Expand Up @@ -102,8 +102,9 @@ if [ "${REQUEST_METHOD:-}" = POST ]; then
read -r line
done
if [ "$type" = bin ]; then # binary file upload
# binary-read stdin till next step
sed -n -e "{:loop p; n;/^$sep/q; b loop}" >$CGIBASHOPTS_TMP
# binary-read stdin till next step. -u and q stops reading immediately
# When changed, update code copy in tests/filefield-runaway.test
sed -u -n -e "{:loop p; n;/^$sep/q; b loop}" >$CGIBASHOPTS_TMP
[ $CGIBASHOPTS_TMP != /dev/null ] && \
truncate -s -2 $CGIBASHOPTS_TMP # remove last \r\n
elif [ "$type" = txt ]; then # text file upload
Expand Down

0 comments on commit 14e2dfa

Please sign in to comment.