From f2d09291474030c949a19e823d83fb62c09a0b54 Mon Sep 17 00:00:00 2001 From: Ludovic Arnaud Date: Thu, 10 Apr 2003 19:11:09 +0000 Subject: [PATCH] Moved up flood-check a little to save a query whenever possible git-svn-id: file:///svn/phpbb/trunk@3806 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/posting.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/posting.php b/phpBB/posting.php index b3e1f7dcfd..a3d81beae9 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -495,7 +495,7 @@ if (($submit) || ($preview) || ($refresh)) $err_msg .= ((!empty($err_msg)) ? '
' : '') . $result; } - if (($mode != 'edit') && (!$preview) && (!$refresh)) + if (($mode != 'edit') && (!$preview) && (!$refresh) && (!$perm['f_ignoreflood'])) { // Flood check $where_sql = ($user->data['user_id'] == ANONYMOUS) ? "poster_ip = '$user->ip'" : 'poster_id = ' . $user->data['user_id']; @@ -506,7 +506,7 @@ if (($submit) || ($preview) || ($refresh)) if ($row = $db->sql_fetchrow($result)) { - if (intval($row['last_post_time']) && ($current_time - intval($row['last_post_time'])) < intval($config['flood_interval']) && !$perm['f_ignoreflood']) + if (intval($row['last_post_time']) && ($current_time - intval($row['last_post_time'])) < intval($config['flood_interval'])) { $err_msg .= ((!empty($err_msg)) ? '
' : '') . $user->lang['FLOOD_ERROR']; }