diff --git a/phpBB/language/en/posting.php b/phpBB/language/en/posting.php
index 426475e77a..570cf63f17 100644
--- a/phpBB/language/en/posting.php
+++ b/phpBB/language/en/posting.php
@@ -140,6 +140,7 @@ $lang = array_merge($lang, array(
'IMAGES_ARE_OFF' => '[img] is OFF',
'IMAGES_ARE_ON' => '[img] is ON',
'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/factory.php b/phpBB/phpbb/textformatter/s9e/factory.php
index 6191b9a315..dca1c78d40 100644
--- a/phpBB/phpbb/textformatter/s9e/factory.php
+++ b/phpBB/phpbb/textformatter/s9e/factory.php
@@ -110,7 +110,7 @@ class factory implements \phpbb\textformatter\cache_interface
'i' => '',
'u' => '',
'img' => '
',
- 'size' => '',
+ 'size' => 'font-size: %; line-height: normal',
'color' => '',
'email' => '
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));
diff --git a/phpBB/styles/prosilver/template/bbcode.html b/phpBB/styles/prosilver/template/bbcode.html
index 940c0ace29..f4ec94dbfe 100644
--- a/phpBB/styles/prosilver/template/bbcode.html
+++ b/phpBB/styles/prosilver/template/bbcode.html
@@ -64,7 +64,7 @@
{TEXT}
-{TEXT}
+font-size: %; line-height: normal
diff --git a/tests/text_formatter/s9e/default_formatting_test.php b/tests/text_formatter/s9e/default_formatting_test.php
index a35c9138a5..1aa4f0bc3a 100644
--- a/tests/text_formatter/s9e/default_formatting_test.php
+++ b/tests/text_formatter/s9e/default_formatting_test.php
@@ -70,7 +70,7 @@ class phpbb_textformatter_s9e_default_formatting_test extends phpbb_test_case
),
array(
'[size=75]smaller[/size]',
- 'smaller'
+ 'smaller'
),
array(
'[quote]quoted[/quote]',
diff --git a/tests/text_processing/tickets_data/PHPBB3-13921.html b/tests/text_processing/tickets_data/PHPBB3-13921.html
index 690668ef28..6a9dc7f504 100644
--- a/tests/text_processing/tickets_data/PHPBB3-13921.html
+++ b/tests/text_processing/tickets_data/PHPBB3-13921.html
@@ -1 +1 @@
-xxx
\ No newline at end of file
+xxx
\ No newline at end of file