diff options
author | Marc Alexander <admin@m-a-styles.de> | 2019-08-25 18:28:08 +0200 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2019-08-25 18:28:08 +0200 |
commit | 79be901cea18960bbcb8571f4e2c0d982d3ca015 (patch) | |
tree | 9438a09ca35aed1253147e3096021abbca67e27d /phpBB/phpbb/textformatter/s9e/parser.php | |
parent | 26215517dd04434333bddbc06b9ae92a845fb494 (diff) | |
parent | f75577e5f858e43e202010f6889bd55096f75ea3 (diff) | |
download | forums-79be901cea18960bbcb8571f4e2c0d982d3ca015.tar forums-79be901cea18960bbcb8571f4e2c0d982d3ca015.tar.gz forums-79be901cea18960bbcb8571f4e2c0d982d3ca015.tar.bz2 forums-79be901cea18960bbcb8571f4e2c0d982d3ca015.tar.xz forums-79be901cea18960bbcb8571f4e2c0d982d3ca015.zip |
Merge pull request #51 from phpbb/ticket/security/243
[ticket/security/243] Limit size BBCode to int
Diffstat (limited to 'phpBB/phpbb/textformatter/s9e/parser.php')
-rw-r--r-- | phpBB/phpbb/textformatter/s9e/parser.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/phpBB/phpbb/textformatter/s9e/parser.php b/phpBB/phpbb/textformatter/s9e/parser.php index 3698dca224..1bc56a8cb4 100644 --- a/phpBB/phpbb/textformatter/s9e/parser.php +++ b/phpBB/phpbb/textformatter/s9e/parser.php @@ -228,6 +228,10 @@ class parser implements \phpbb\textformatter\parser_interface { $errors[] = array($msg); } + else if ($msg === 'INVALID_FONT_SIZE') + { + $errors[] = [$msg, $context['invalid_size']]; + } } // Deduplicate error messages. array_unique() only works on strings so we have to serialize @@ -335,6 +339,13 @@ class parser implements \phpbb\textformatter\parser_interface */ static public function filter_font_size($size, $max_size, Logger $logger) { + if (!is_numeric($size)) + { + $logger->err('INVALID_FONT_SIZE', ['invalid_size' => htmlspecialchars($size)]); + + return false; + } + if ($max_size && $size > $max_size) { $logger->err('MAX_FONT_SIZE_EXCEEDED', array('max_size' => $max_size)); |