mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
Merge pull request #4865 from JoshyPHP/ticket/15261
[ticket/15261] Fix censoring HTML tags
This commit is contained in:
commit
337c8451e7
6 changed files with 27 additions and 15 deletions
|
@ -33,7 +33,7 @@
|
||||||
"marc1706/fast-image-size": "^1.1",
|
"marc1706/fast-image-size": "^1.1",
|
||||||
"paragonie/random_compat": "^1.4",
|
"paragonie/random_compat": "^1.4",
|
||||||
"patchwork/utf8": "^1.1",
|
"patchwork/utf8": "^1.1",
|
||||||
"s9e/text-formatter": "~0.9.0",
|
"s9e/text-formatter": "~0.10.0",
|
||||||
"symfony/config": "^2.8",
|
"symfony/config": "^2.8",
|
||||||
"symfony/console": "^2.8",
|
"symfony/console": "^2.8",
|
||||||
"symfony/debug": "^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",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"hash": "a66e58446c273c4b92f8e5f227180be8",
|
"hash": "3b947e5d38012be6ef86609c709c7b4b",
|
||||||
"content-hash": "d3646acce6058e89ebcf76debb7f72ea",
|
"content-hash": "447fa8ed870502dc3089b0a0ffa08ef0",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "bantu/ini-get-wrapper",
|
"name": "bantu/ini-get-wrapper",
|
||||||
|
@ -660,16 +660,16 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "s9e/text-formatter",
|
"name": "s9e/text-formatter",
|
||||||
"version": "0.9.6",
|
"version": "0.10.1",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/s9e/TextFormatter.git",
|
"url": "https://github.com/s9e/TextFormatter.git",
|
||||||
"reference": "077c510109f3011dec68a5bcbaeb93a1f9138128"
|
"reference": "9380fd3d3e3289d7e966bab7769ca2aae5d23f67"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/s9e/TextFormatter/zipball/077c510109f3011dec68a5bcbaeb93a1f9138128",
|
"url": "https://api.github.com/repos/s9e/TextFormatter/zipball/9380fd3d3e3289d7e966bab7769ca2aae5d23f67",
|
||||||
"reference": "077c510109f3011dec68a5bcbaeb93a1f9138128",
|
"reference": "9380fd3d3e3289d7e966bab7769ca2aae5d23f67",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
@ -721,7 +721,7 @@
|
||||||
"parser",
|
"parser",
|
||||||
"shortcodes"
|
"shortcodes"
|
||||||
],
|
],
|
||||||
"time": "2017-05-10 19:37:30"
|
"time": "2017-07-03 13:55:54"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/config",
|
"name": "symfony/config",
|
||||||
|
@ -2825,9 +2825,7 @@
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "Fabien Potencier",
|
"name": "Fabien Potencier",
|
||||||
"email": "fabien@symfony.com",
|
"email": "fabien@symfony.com"
|
||||||
"homepage": "http://fabien.potencier.org",
|
|
||||||
"role": "Lead Developer"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "Pimple is a simple Dependency Injection Container for PHP 5.3",
|
"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');
|
$vars = array('renderer', 'xml');
|
||||||
extract($this->dispatcher->trigger_event('core.text_formatter_s9e_render_before', compact($vars)));
|
extract($this->dispatcher->trigger_event('core.text_formatter_s9e_render_before', compact($vars)));
|
||||||
|
|
||||||
|
$html = $this->renderer->render($xml);
|
||||||
if (isset($this->censor) && $this->viewcensors)
|
if (isset($this->censor) && $this->viewcensors)
|
||||||
{
|
{
|
||||||
// NOTE: censorHtml() is XML-safe
|
$html = $this->censor->censorHtml($html, true);
|
||||||
$xml = $this->censor->censorHtml($xml, true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$html = $this->renderer->render($xml);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Modify a rendered text
|
* 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…
Add table
Reference in a new issue