diff options
| author | Christian Fowler <spider@viovio.com> | 2009-09-15 14:34:57 +0000 |
|---|---|---|
| committer | Christian Fowler <spider@viovio.com> | 2009-09-15 14:34:57 +0000 |
| commit | 27f2cb6b1f8b421c2c6b187330a46b168c8a9514 (patch) | |
| tree | dd5ed89add72c5a67614dbd00efd03122f0ff5c9 | |
| parent | 4288e85332c2c8bedb1dc493c852d6b5fd886c73 (diff) | |
| download | liberty-27f2cb6b1f8b421c2c6b187330a46b168c8a9514.tar.gz liberty-27f2cb6b1f8b421c2c6b187330a46b168c8a9514.tar.bz2 liberty-27f2cb6b1f8b421c2c6b187330a46b168c8a9514.zip | |
limit duplicate post check to the same content_id (root_id)
| -rw-r--r-- | LibertyComment.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/LibertyComment.php b/LibertyComment.php index 5d0c171..fef06a2 100644 --- a/LibertyComment.php +++ b/LibertyComment.php @@ -3,7 +3,7 @@ * Management of Liberty Content * * @package liberty - * @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertyComment.php,v 1.87 2009/08/25 21:28:46 tylerbello Exp $ + * @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertyComment.php,v 1.88 2009/09/15 14:34:57 spiderr Exp $ * @author spider <spider@steelsun.com> */ @@ -129,8 +129,8 @@ class LibertyComment extends LibertyMime { } elseif( !$gBitUser->hasPermission( 'p_liberty_trusted_editor' ) && ($linkCount = preg_match_all( '/http\:\/\//', $pParamHash['edit'], $links )) > $gBitSystem->getConfig( 'liberty_unstrusted_max_http_in_content', 0 ) ) { $this->mErrors['store'] = tra( 'Links are not allowed.' ); } else { - $dupeQuery = "SELECT `data` FROM `".BIT_DB_PREFIX."liberty_content` WHERE `user_id`=? AND `content_type_guid`='".BITCOMMENT_CONTENT_TYPE_GUID."' AND `ip`=? ORDER BY `created` DESC"; - if( $lastPostData = $this->mDb->getOne( $dupeQuery, array( $gBitUser->mUserId, $_SERVER['REMOTE_ADDR'] ) ) ) { + $dupeQuery = "SELECT `data` FROM `".BIT_DB_PREFIX."liberty_content` lc INNER JOIN `".BIT_DB_PREFIX."liberty_comments` lcom ON (lc.`content_id`=lcom.`content_id`) WHERE `user_id`=? AND `content_type_guid`='".BITCOMMENT_CONTENT_TYPE_GUID."' AND `ip`=? AND lcom.`root_id`=? ORDER BY `created` DESC"; + if( $lastPostData = $this->mDb->getOne( $dupeQuery, array( $gBitUser->mUserId, $_SERVER['REMOTE_ADDR'], $pParamHash['root_id'] ) ) ) { if( trim( $lastPostData ) == trim( $pParamHash['edit'] ) ) { $this->mErrors['store'] = tra( 'Duplicate comment.' ); } |
