1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-03-13 20:28:44 +01:00

[ticket/15464] Detect BBCodes in uppercase when reparsing

PHPBB3-15464
This commit is contained in:
JoshyPHP 2017-11-23 16:25:48 +01:00
parent 0517e43dff
commit a7664811dd
3 changed files with 25 additions and 2 deletions

View File

@ -153,8 +153,8 @@ abstract class base implements reparser_interface
{
// Look for the closing tag inside of a e element, in an element of the same name, e.g.
// <e>[/url]</e></URL>
$match = '<e>[/' . $bbcode . ']</e></' . strtoupper($bbcode) . '>';
if (strpos($record['text'], $match) !== false)
$match = '<e>[/' . $bbcode . ']</e></' . $bbcode . '>';
if (stripos($record['text'], $match) !== false)
{
return true;
}

View File

@ -66,4 +66,19 @@ class phpbb_textreparser_base_test extends phpbb_database_test_case
$this->get_rows(array(1))
);
}
public function test_reparse_case_insensitive()
{
$this->get_reparser()->reparse_range(2, 2);
$this->assertEquals(
[
[
'id' => '2',
'text' => '<r><IMG src="img.png"><s>[IMG]</s>img.png<e>[/IMG]</e></IMG></r>'
]
],
$this->get_rows([2])
);
}
}

View File

@ -15,5 +15,13 @@
<value></value>
<value>abcd1234</value>
</row>
<row>
<value>2</value>
<value>1</value>
<value>1</value>
<value>1</value>
<value><![CDATA[<r><IMG src="img.png"><s>[IMG]</s>img.png<e>[/IMG]</e></IMG></r>]]></value>
<value></value>
</row>
</table>
</dataset>