# HG changeset patch # User HIROSE Yuuji # Date 1591051924 -32400 # Node ID 98702a1251cdd122d8a13d43838817c788adca05 # Parent 33df7d50532ec29d0d959c2b58f68ee5c1fb72eb# Parent b73e2399994cc8acc4f0e57d4d364e01d37e9167 merged diff -r b73e2399994c -r 98702a1251cd s4-funcs.sh --- a/s4-funcs.sh Sun May 31 21:30:29 2020 +0900 +++ b/s4-funcs.sh Tue Jun 02 07:52:04 2020 +0900 @@ -1461,9 +1461,6 @@ mogrify -quality 75 -resize $maximagexy'>' "$tmpd/$v" err "Mogrified: `ls -lF $tmpd/$v`" # 2020-05-31 ;; - [Aa]pplication/*-empty) - err "Stream-Empty found: [$v]"; cp "$tmpf" tmp/ - ;; esac if ! echo "$mimetype" | egrep "$file_accept_egrep" >/dev/null 2>&1 then @@ -3647,6 +3644,7 @@ # 6: Password length too short # 7: Password mismatch # 8: Old password incorrect + # 9: Duplicated post rowid=`getpar rowid` if [ ! -e $1 ]; then echo "テーブル定義ファイルが見付かりません" | html p @@ -3733,6 +3731,22 @@ done else # New entry + # XXX: WORK-AROUND FOR SOME STUPID BROWSER + # Avoid empty repost of article. + if [ x"$tbl" = x"article" ]; then + # If rowid is empty and ID exists in article-table, that is REPOST! + aid=`getpar id` + xaid=`query "SELECT id FROM $tbl WHERE id='$aid';"` + if [ -n "$xaid" ]; then + # REPOST of article + html p <<-EOF + 書き込み直後のリロードなので上書きを回避します。 + 最新記事は末尾の「再読み込み」ボタンから見てください。 + EOF + err "Repost aid=$aid Browser=[$HTTP_USER_AGENT] user=$user" + return 9 # STOP Duplicated posting + fi + fi # Generate values() for primary keys for col in `gettblpkey $tbl`; do # Genuine primary keys for _m and _s @@ -3788,6 +3802,10 @@ case `gettbl_coltype $tbl/$origcol` in image|document|binary) file=$tmpd/`getparfilename $v` + if [ ! -s "$file" ]; then # Maybe stupid REPOST + err "Empty REPOST by [$HTTP_USER_AGENT] user=$user" + continue + fi ## err type=file=$file [ -z "$file" ] && continue bn=`sqlquotestr "${file##*/}"`