mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 05:50:42 +02:00
[ticket/10240] Added code to strip control characters from messages.
It is possible to evade the word filter using control characters. Seeing as control characters have no practical application in a bulletin board software, it doesn't do any harm to remove them entirely. That is what this commit does. PHPBB3-10240
This commit is contained in:
committed by
callumacrae
parent
e4707a8be7
commit
f9dbe33fa7
@@ -691,6 +691,9 @@ function censor_text($text)
|
||||
return '';
|
||||
}
|
||||
|
||||
// Strip control characters
|
||||
$text = preg_replace('/[\x00-\x0f]/', '', $text);
|
||||
|
||||
// We moved the word censor checks in here because we call this function quite often - and then only need to do the check once
|
||||
if (!isset($censors) || !is_array($censors))
|
||||
{
|
||||
|
Reference in New Issue
Block a user