aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--phpBB/language/en/posting.php1
-rw-r--r--phpBB/phpbb/textformatter/s9e/parser.php11
2 files changed, 12 insertions, 0 deletions
diff --git a/phpBB/language/en/posting.php b/phpBB/language/en/posting.php
index 11ea6483e1..8f43ee7656 100644
--- a/phpBB/language/en/posting.php
+++ b/phpBB/language/en/posting.php
@@ -139,6 +139,7 @@ $lang = array_merge($lang, array(
'IMAGES_ARE_OFF' => '[img] is <em>OFF</em>',
'IMAGES_ARE_ON' => '[img] is <em>ON</em>',
'INVALID_FILENAME' => '%s is an invalid filename.',
+ 'INVALID_FONT_SIZE' => 'The font size you supplied is invalid: %s',
'LOAD' => 'Load',
'LOAD_DRAFT' => 'Load draft',
diff --git a/phpBB/phpbb/textformatter/s9e/parser.php b/phpBB/phpbb/textformatter/s9e/parser.php
index 3698dca224..e30bc2b0d9 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_int($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));