From 88f476be53320f2b1222b1302e4452e3ca240b8e Mon Sep 17 00:00:00 2001 From: Henry Sudhof Date: Tue, 15 May 2007 17:03:50 +0000 Subject: Triggering Error messages in the ban function is not pretty. We'll continue to do it for now, though. #10966 git-svn-id: file:///svn/phpbb/trunk@7591 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_user.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'phpBB/includes/functions_user.php') diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index d460ebdbf7..375d85a34a 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -657,7 +657,15 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas else { $ban_other = explode('-', $ban_len_other); - $ban_end = max($current_time, gmmktime(0, 0, 0, $ban_other[1], $ban_other[2], $ban_other[0])); + if (sizeof($ban_other) == 3 && ((int)$ban_other[0] < 9999) && + (strlen($ban_other[0]) == 4) && (strlen($ban_other[1]) == 2) && (strlen($ban_other[2]) == 2)) + { + $ban_end = max($current_time, gmmktime(0, 0, 0, (int)$ban_other[1], (int)$ban_other[2], (int)$ban_other[0])); + } + else + { + trigger_error($user->lang['LENGTH_BAN_INVALID']); + } } } else -- cgit v1.2.1