mirror of
https://github.com/phpbb/phpbb.git
synced 2025-03-20 23:51:28 +01:00
Merge pull request #4865 from JoshyPHP/ticket/15261
[ticket/15261] Fix censoring HTML tags
This commit is contained in:
commit
337c8451e7
@ -33,7 +33,7 @@
|
||||
"marc1706/fast-image-size": "^1.1",
|
||||
"paragonie/random_compat": "^1.4",
|
||||
"patchwork/utf8": "^1.1",
|
||||
"s9e/text-formatter": "~0.9.0",
|
||||
"s9e/text-formatter": "~0.10.0",
|
||||
"symfony/config": "^2.8",
|
||||
"symfony/console": "^2.8",
|
||||
"symfony/debug": "^2.8",
|
||||
|
18
phpBB/composer.lock
generated
18
phpBB/composer.lock
generated
@ -4,8 +4,8 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"hash": "a66e58446c273c4b92f8e5f227180be8",
|
||||
"content-hash": "d3646acce6058e89ebcf76debb7f72ea",
|
||||
"hash": "3b947e5d38012be6ef86609c709c7b4b",
|
||||
"content-hash": "447fa8ed870502dc3089b0a0ffa08ef0",
|
||||
"packages": [
|
||||
{
|
||||
"name": "bantu/ini-get-wrapper",
|
||||
@ -660,16 +660,16 @@
|
||||
},
|
||||
{
|
||||
"name": "s9e/text-formatter",
|
||||
"version": "0.9.6",
|
||||
"version": "0.10.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/s9e/TextFormatter.git",
|
||||
"reference": "077c510109f3011dec68a5bcbaeb93a1f9138128"
|
||||
"reference": "9380fd3d3e3289d7e966bab7769ca2aae5d23f67"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/s9e/TextFormatter/zipball/077c510109f3011dec68a5bcbaeb93a1f9138128",
|
||||
"reference": "077c510109f3011dec68a5bcbaeb93a1f9138128",
|
||||
"url": "https://api.github.com/repos/s9e/TextFormatter/zipball/9380fd3d3e3289d7e966bab7769ca2aae5d23f67",
|
||||
"reference": "9380fd3d3e3289d7e966bab7769ca2aae5d23f67",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -721,7 +721,7 @@
|
||||
"parser",
|
||||
"shortcodes"
|
||||
],
|
||||
"time": "2017-05-10 19:37:30"
|
||||
"time": "2017-07-03 13:55:54"
|
||||
},
|
||||
{
|
||||
"name": "symfony/config",
|
||||
@ -2825,9 +2825,7 @@
|
||||
"authors": [
|
||||
{
|
||||
"name": "Fabien Potencier",
|
||||
"email": "fabien@symfony.com",
|
||||
"homepage": "http://fabien.potencier.org",
|
||||
"role": "Lead Developer"
|
||||
"email": "fabien@symfony.com"
|
||||
}
|
||||
],
|
||||
"description": "Pimple is a simple Dependency Injection Container for PHP 5.3",
|
||||
|
@ -247,14 +247,12 @@ class renderer implements \phpbb\textformatter\renderer_interface
|
||||
$vars = array('renderer', 'xml');
|
||||
extract($this->dispatcher->trigger_event('core.text_formatter_s9e_render_before', compact($vars)));
|
||||
|
||||
$html = $this->renderer->render($xml);
|
||||
if (isset($this->censor) && $this->viewcensors)
|
||||
{
|
||||
// NOTE: censorHtml() is XML-safe
|
||||
$xml = $this->censor->censorHtml($xml, true);
|
||||
$html = $this->censor->censorHtml($html, true);
|
||||
}
|
||||
|
||||
$html = $this->renderer->render($xml);
|
||||
|
||||
/**
|
||||
* Modify a rendered text
|
||||
*
|
||||
|
1
tests/text_processing/tickets_data/PHPBB3-15261.html
Normal file
1
tests/text_processing/tickets_data/PHPBB3-15261.html
Normal file
@ -0,0 +1 @@
|
||||
foo **** baz
|
1
tests/text_processing/tickets_data/PHPBB3-15261.txt
Normal file
1
tests/text_processing/tickets_data/PHPBB3-15261.txt
Normal file
@ -0,0 +1 @@
|
||||
foo <bar> baz
|
14
tests/text_processing/tickets_data/PHPBB3-15261.xml
Normal file
14
tests/text_processing/tickets_data/PHPBB3-15261.xml
Normal file
@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<dataset>
|
||||
<table name="phpbb_words">
|
||||
<column>word_id</column>
|
||||
<column>word</column>
|
||||
<column>replacement</column>
|
||||
|
||||
<row>
|
||||
<value>1</value>
|
||||
<value><*></value>
|
||||
<value>****</value>
|
||||
</row>
|
||||
</table>
|
||||
</dataset>
|
Loading…
x
Reference in New Issue
Block a user