comparison s4-funcs.sh @ 730:2c0c25fc9f68

Workaround for reposting from resuming browsers
author HIROSE Yuuji <yuuji@gentei.org>
date Mon, 01 Jun 2020 19:31:36 +0900
parents 01be32e89ccd
children 33df7d50532e
comparison
equal deleted inserted replaced
726:01be32e89ccd 730:2c0c25fc9f68
1457 ;; 1457 ;;
1458 [Ii]mage/*) 1458 [Ii]mage/*)
1459 mogrify -quality 75 -resize $maximagexy'>' "$tmpd/$v" 1459 mogrify -quality 75 -resize $maximagexy'>' "$tmpd/$v"
1460 err "Mogrified: `ls -lF $tmpd/$v`" # 2020-05-31 1460 err "Mogrified: `ls -lF $tmpd/$v`" # 2020-05-31
1461 ;; 1461 ;;
1462 [Aa]pplication/*-empty)
1463 err "Stream-Empty found: [$v]"; cp "$tmpf" tmp/
1464 ;;
1465 esac 1462 esac
1466 if ! echo "$mimetype" | egrep "$file_accept_egrep" >/dev/null 2>&1 1463 if ! echo "$mimetype" | egrep "$file_accept_egrep" >/dev/null 2>&1
1467 then 1464 then
1468 replpar text string " *添付できない形式です($v)* $file_warn" 1465 replpar text string " *添付できない形式です($v)* $file_warn"
1469 continue 1466 continue
3643 # 4: SUCCESS to delete 3640 # 4: SUCCESS to delete
3644 # 5: Stop deletion for lack of confirm check 3641 # 5: Stop deletion for lack of confirm check
3645 # 6: Password length too short 3642 # 6: Password length too short
3646 # 7: Password mismatch 3643 # 7: Password mismatch
3647 # 8: Old password incorrect 3644 # 8: Old password incorrect
3645 # 9: Duplicated post
3648 rowid=`getpar rowid` 3646 rowid=`getpar rowid`
3649 if [ ! -e $1 ]; then 3647 if [ ! -e $1 ]; then
3650 echo "テーブル定義ファイルが見付かりません" | html p 3648 echo "テーブル定義ファイルが見付かりません" | html p
3651 exit 1 3649 exit 1
3652 fi 3650 fi
3729 val=`query "select $col from $tbl where rowid=$rowid;"|sed -e 's/\"/\"\"/g'` 3727 val=`query "select $col from $tbl where rowid=$rowid;"|sed -e 's/\"/\"\"/g'`
3730 pval="$pval${pval:+, }\"$val\"" 3728 pval="$pval${pval:+, }\"$val\""
3731 done 3729 done
3732 else 3730 else
3733 # New entry 3731 # New entry
3732 # XXX: WORK-AROUND FOR SOME STUPID BROWSER
3733 # Avoid empty repost of article.
3734 if [ x"$tbl" = x"article" ]; then
3735 # If rowid is empty and ID exists in article-table, that is REPOST!
3736 aid=`getpar id`
3737 xaid=`query "SELECT id FROM $tbl WHERE id='$aid';"`
3738 if [ -n "$xaid" ]; then
3739 # REPOST of article
3740 html p <<-EOF
3741 書き込み直後のリロードなので上書きを回避します。
3742 最新記事は末尾の「再読み込み」ボタンから見てください。
3743 EOF
3744 err "Repost aid=$aid Browser=[$HTTP_USER_AGENT]"
3745 return 9 # STOP Duplicated posting
3746 fi
3747 fi
3734 # Generate values() for primary keys 3748 # Generate values() for primary keys
3735 for col in `gettblpkey $tbl`; do 3749 for col in `gettblpkey $tbl`; do
3736 # Genuine primary keys for _m and _s 3750 # Genuine primary keys for _m and _s
3737 val=`getvalquote $tbl $col` 3751 val=`getvalquote $tbl $col`
3738 [ -z "$val" ] && continue 3752 [ -z "$val" ] && continue

yatex.org