diff options
author | JoshyPHP <s9e.dev@gmail.com> | 2015-07-06 19:17:40 +0200 |
---|---|---|
committer | JoshyPHP <s9e.dev@gmail.com> | 2015-07-06 19:17:40 +0200 |
commit | a44711e57478c6f9d1fa38582deae72cad240560 (patch) | |
tree | ec7b7b5876a606bc5931026d55099fba8abe13ec /phpBB/phpbb/textreparser/base.php | |
parent | f81a2bc7c56cfcb57feaed293be87bbe640dfa5f (diff) | |
download | forums-a44711e57478c6f9d1fa38582deae72cad240560.tar forums-a44711e57478c6f9d1fa38582deae72cad240560.tar.gz forums-a44711e57478c6f9d1fa38582deae72cad240560.tar.bz2 forums-a44711e57478c6f9d1fa38582deae72cad240560.tar.xz forums-a44711e57478c6f9d1fa38582deae72cad240560.zip |
[ticket/13990] Reparse markup inside of forum rules/description
PHPBB3-13990
Diffstat (limited to 'phpBB/phpbb/textreparser/base.php')
-rw-r--r-- | phpBB/phpbb/textreparser/base.php | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/phpBB/phpbb/textreparser/base.php b/phpBB/phpbb/textreparser/base.php index 87a4268d0d..ed6c2376c7 100644 --- a/phpBB/phpbb/textreparser/base.php +++ b/phpBB/phpbb/textreparser/base.php @@ -47,11 +47,22 @@ abstract class base implements reparser_interface { if (!isset($record['enable_bbcode'], $record['enable_smilies'], $record['enable_magic_url'])) { - $record += array( - 'enable_bbcode' => $this->guess_bbcodes($record), - 'enable_smilies' => $this->guess_smilies($record), - 'enable_magic_url' => $this->guess_magic_url($record), - ); + if (isset($record['options'])) + { + $record += array( + 'enable_bbcode' => (bool) ($record['options'] & OPTION_FLAG_BBCODE), + 'enable_smilies' => (bool) ($record['options'] & OPTION_FLAG_SMILIES), + 'enable_magic_url' => (bool) ($record['options'] & OPTION_FLAG_LINKS), + ); + } + else + { + $record += array( + 'enable_bbcode' => $this->guess_bbcodes($record), + 'enable_smilies' => $this->guess_smilies($record), + 'enable_magic_url' => $this->guess_magic_url($record), + ); + } } // Those BBCodes are disabled based on context and user permissions and that value is never @@ -92,7 +103,7 @@ abstract class base implements reparser_interface } } - if (substr($record['text'], 0, 2) == '<r') + if (substr($record['text'], 0, 2) === '<r') { // Look for the closing tag inside of a e element, in an element of the same name, e.g. // <e>[/url]</e></URL> @@ -124,7 +135,7 @@ abstract class base implements reparser_interface } } - if (substr($record['text'], 0, 2) == '<r') + if (substr($record['text'], 0, 2) === '<r') { // Look for a closing tag inside of an e element return (bool) preg_match('(<e>\\[/\\w+\\]</e>)', $match); |