mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-05 14:04:57 +02:00
Merge pull request #5051 from JoshyPHP/ticket/15464
[ticket/15464] Detect BBCodes in uppercase when reparsing
This commit is contained in:
commit
81a71f71c7
@ -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.
|
// Look for the closing tag inside of a e element, in an element of the same name, e.g.
|
||||||
// <e>[/url]</e></URL>
|
// <e>[/url]</e></URL>
|
||||||
$match = '<e>[/' . $bbcode . ']</e></' . strtoupper($bbcode) . '>';
|
$match = '<e>[/' . $bbcode . ']</e></' . $bbcode . '>';
|
||||||
if (strpos($record['text'], $match) !== false)
|
if (stripos($record['text'], $match) !== false)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -66,4 +66,19 @@ class phpbb_textreparser_base_test extends phpbb_database_test_case
|
|||||||
$this->get_rows(array(1))
|
$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></value>
|
||||||
<value>abcd1234</value>
|
<value>abcd1234</value>
|
||||||
</row>
|
</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>
|
</table>
|
||||||
</dataset>
|
</dataset>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user