Mercurial > hgrepos > hgweb.cgi > s4
comparison s4-funcs.sh @ 731:33df7d50532e
Empty-repost workaround in EDIT mode added
author | HIROSE Yuuji <yuuji@gentei.org> |
---|---|
date | Mon, 01 Jun 2020 20:25:02 +0900 |
parents | 2c0c25fc9f68 |
children | 98702a1251cd |
comparison
equal
deleted
inserted
replaced
730:2c0c25fc9f68 | 731:33df7d50532e |
---|---|
3739 # REPOST of article | 3739 # REPOST of article |
3740 html p <<-EOF | 3740 html p <<-EOF |
3741 書き込み直後のリロードなので上書きを回避します。 | 3741 書き込み直後のリロードなので上書きを回避します。 |
3742 最新記事は末尾の「再読み込み」ボタンから見てください。 | 3742 最新記事は末尾の「再読み込み」ボタンから見てください。 |
3743 EOF | 3743 EOF |
3744 err "Repost aid=$aid Browser=[$HTTP_USER_AGENT]" | 3744 err "Repost aid=$aid Browser=[$HTTP_USER_AGENT] user=$user" |
3745 return 9 # STOP Duplicated posting | 3745 return 9 # STOP Duplicated posting |
3746 fi | 3746 fi |
3747 fi | 3747 fi |
3748 # Generate values() for primary keys | 3748 # Generate values() for primary keys |
3749 for col in `gettblpkey $tbl`; do | 3749 for col in `gettblpkey $tbl`; do |
3798 fi ;; | 3798 fi ;; |
3799 edit) | 3799 edit) |
3800 case `gettbl_coltype $tbl/$origcol` in | 3800 case `gettbl_coltype $tbl/$origcol` in |
3801 image|document|binary) | 3801 image|document|binary) |
3802 file=$tmpd/`getparfilename $v` | 3802 file=$tmpd/`getparfilename $v` |
3803 if [ ! -s "$file" ]; then # Maybe stupid REPOST | |
3804 err "Empty REPOST by [$HTTP_USER_AGENT] user=$user" | |
3805 continue | |
3806 fi | |
3803 ## err type=file=$file | 3807 ## err type=file=$file |
3804 [ -z "$file" ] && continue | 3808 [ -z "$file" ] && continue |
3805 bn=`sqlquotestr "${file##*/}"` | 3809 bn=`sqlquotestr "${file##*/}"` |
3806 bin="X'"$(hexize "$file")"'" | 3810 bin="X'"$(hexize "$file")"'" |
3807 ct=`file --mime-type - < "$file" |cut -d' ' -f2` | 3811 ct=`file --mime-type - < "$file" |cut -d' ' -f2` |