From da9da88d11f1d62105268def24ae70c0e64bb840 Mon Sep 17 00:00:00 2001 From: rxu Date: Sun, 18 Nov 2018 01:33:56 +0700 Subject: [ticket/15875] Fix PHP fatal error on BBCode parsing PHPBB3-15875 --- phpBB/includes/bbcode.php | 11 ++++++++++- phpBB/includes/functions_content.php | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/bbcode.php b/phpBB/includes/bbcode.php index c00f9bd207..c31b63a403 100644 --- a/phpBB/includes/bbcode.php +++ b/phpBB/includes/bbcode.php @@ -35,9 +35,18 @@ class bbcode /** * Constructor - * Init bbcode cache entries if bitfield is specified */ function __construct($bitfield = '') + { + $this->bbcode_set_bitfield($bitfield); + } + + /** + * Init bbcode cache entries if bitfield is specified + * + * @param string $bbcode_bitfield The bbcode bitfield + */ + function bbcode_set_bitfield($bitfield = '') { if ($bitfield) { diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php index 43dce036a3..8284aab6a4 100644 --- a/phpBB/includes/functions_content.php +++ b/phpBB/includes/functions_content.php @@ -627,7 +627,7 @@ function generate_text_for_display($text, $uid, $bitfield, $flags, $censor_text } else { - $bbcode->bbcode($bitfield); + $bbcode->bbcode_set_bitfield($bitfield); } $bbcode->bbcode_second_pass($text, $uid); -- cgit v1.2.1