aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenry Sudhof <kellanved@phpbb.com>2007-05-15 17:03:50 +0000
committerHenry Sudhof <kellanved@phpbb.com>2007-05-15 17:03:50 +0000
commit88f476be53320f2b1222b1302e4452e3ca240b8e (patch)
treea78b7ad63cad4565b55c01af7c33d29042f752ab
parent0b94cfb70259e27db9ff892bc1251132269d6247 (diff)
downloadforums-88f476be53320f2b1222b1302e4452e3ca240b8e.tar
forums-88f476be53320f2b1222b1302e4452e3ca240b8e.tar.gz
forums-88f476be53320f2b1222b1302e4452e3ca240b8e.tar.bz2
forums-88f476be53320f2b1222b1302e4452e3ca240b8e.tar.xz
forums-88f476be53320f2b1222b1302e4452e3ca240b8e.zip
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
-rw-r--r--phpBB/includes/functions_user.php10
-rw-r--r--phpBB/language/en/acp/ban.php4
2 files changed, 13 insertions, 1 deletions
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
diff --git a/phpBB/language/en/acp/ban.php b/phpBB/language/en/acp/ban.php
index d4e91bd226..b7a4bfd702 100644
--- a/phpBB/language/en/acp/ban.php
+++ b/phpBB/language/en/acp/ban.php
@@ -59,6 +59,8 @@ $lang = array_merge($lang, array(
'IP_UNBAN' => 'Un-ban or un-exclude IPs',
'IP_UNBAN_EXPLAIN' => 'You can unban (or un-exclude) multiple IP addresses in one go using the appropriate combination of mouse and keyboard for your computer and browser. Excluded IPs are emphasised.',
+ 'LENGTH_BAN_INVALID' => 'The date has to be formated YYYY-MM-DD',
+
'PERMANENT' => 'Permanent',
'UNTIL' => 'Until',
@@ -68,6 +70,8 @@ $lang = array_merge($lang, array(
'USER_NO_BANNED' => 'No banned usernames',
'USER_UNBAN' => 'Un-ban or un-exclude usernames',
'USER_UNBAN_EXPLAIN' => 'You can unban (or un-exclude) multiple users in one go using the appropriate combination of mouse and keyboard for your computer and browser. Excluded users are emphasised.',
+
+
));
?> \ No newline at end of file