# HG changeset patch # User HIROSE Yuuji # Date 1591007496 -32400 # Node ID 2c0c25fc9f68f97000dd6c1f72d27c3845ed2fdb # Parent 01be32e89ccd3dda94588905d015e7da3bd8a6f5 Workaround for reposting from resuming browsers diff -r 01be32e89ccd -r 2c0c25fc9f68 s4-funcs.sh --- a/s4-funcs.sh Sun May 31 19:06:46 2020 +0900 +++ b/s4-funcs.sh Mon Jun 01 19:31:36 2020 +0900 @@ -1459,9 +1459,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 @@ -3645,6 +3642,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 @@ -3731,6 +3729,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]" + 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