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:
parent
0517e43dff
commit
a7664811dd
@ -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;
|
||||
}
|
||||
|
@ -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])
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -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>
|
||||
|
Loading…
x
Reference in New Issue
Block a user