mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-06 16:56:44 +02:00
prevent posting empty messages with some UTF8-characters as well as fixing conversion in CVS.
git-svn-id: file:///svn/phpbb/trunk@8163 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -1060,8 +1060,8 @@ class parse_message extends bbcode_firstpass
|
||||
$replace = array("\\1:");
|
||||
$this->message = preg_replace($match, $replace, trim($this->message));
|
||||
|
||||
// Message length check. -1 disables this check completely.
|
||||
if ($config['max_' . $mode . '_chars'])
|
||||
// Message length check. 0 disables this check completely.
|
||||
if ($config['max_' . $mode . '_chars'] > 0)
|
||||
{
|
||||
$msg_len = ($mode == 'post') ? utf8_strlen($this->message) : utf8_strlen(preg_replace('#\[\/?[a-z\*\+\-]+(=[\S]+)?\]#ius', ' ', $this->message));
|
||||
|
||||
@@ -1072,6 +1072,13 @@ class parse_message extends bbcode_firstpass
|
||||
}
|
||||
}
|
||||
|
||||
// Check for "empty" message
|
||||
if (!utf8_clean_string($this->message))
|
||||
{
|
||||
$this->warn_msg[] = $user->lang['TOO_FEW_CHARS'];
|
||||
return $this->warn_msg;
|
||||
}
|
||||
|
||||
// Prepare BBcode (just prepares some tags for better parsing)
|
||||
if ($allow_bbcode && strpos($this->message, '[') !== false)
|
||||
{
|
||||
|
Reference in New Issue
Block a user