diff options
author | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2007-09-20 09:26:09 +0800 |
---|---|---|
committer | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2007-09-20 09:26:09 +0800 |
commit | 6f551e0f60ea1fe89c8dfe4e7101fec506c6cf65 (patch) | |
tree | 66000940d0f9db6ddceaf7e1af0a12095b5c901c /mbbsd | |
parent | 121e2d4cee1db307767b168799d0fadbde9d9344 (diff) | |
download | pttbbs-6f551e0f60ea1fe89c8dfe4e7101fec506c6cf65.tar pttbbs-6f551e0f60ea1fe89c8dfe4e7101fec506c6cf65.tar.gz pttbbs-6f551e0f60ea1fe89c8dfe4e7101fec506c6cf65.tar.bz2 pttbbs-6f551e0f60ea1fe89c8dfe4e7101fec506c6cf65.tar.lz pttbbs-6f551e0f60ea1fe89c8dfe4e7101fec506c6cf65.tar.xz pttbbs-6f551e0f60ea1fe89c8dfe4e7101fec506c6cf65.tar.zst pttbbs-6f551e0f60ea1fe89c8dfe4e7101fec506c6cf65.zip |
* deny recommend in short time if article is long
* deny recommend if article is too long
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3561 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r-- | mbbsd/bbs.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c index ba75286c..cc9a893f 100644 --- a/mbbsd/bbs.c +++ b/mbbsd/bbs.c @@ -2373,6 +2373,26 @@ recommend(int ent, fileheader_t * fhdr, const char *direct) return FULLUPDATE; } } + { + // kcwu + char path[PATHLEN]; + int size; + setdirpath(path, direct, fhdr->filename); + size = dashs(path); + if (size > 5*1024*1024) { + vmsg("檔案太大, 無法繼續推文, 請另撰文發表"); + return FULLUPDATE; + } + + if (size > 100*1024) { + int d = 10 - (now - lastrecommend); + if (d > 0) { + vmsgf("本文已過長, 禁止快速連續推文, 請再等 %d 秒", d); + return FULLUPDATE; + } + } + } + #ifdef USE_COOLDOWN if(check_cooldown(bp)) |