Merge branch '3.2.x'

This commit is contained in:
Marc Alexander 2017-12-27 18:16:29 +01:00
commit 1656ca4011
No known key found for this signature in database
GPG key ID: 50E0D2423696F995
14 changed files with 46 additions and 47 deletions

View file

@ -35,7 +35,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.11.0", "s9e/text-formatter": "~0.13.0",
"symfony/config": "~3.1", "symfony/config": "~3.1",
"symfony/console": "~3.1", "symfony/console": "~3.1",
"symfony/debug": "~3.1", "symfony/debug": "~3.1",

18
phpBB/composer.lock generated
View file

@ -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": "9261bee54d8a45fece3e7c83db74e1e0", "hash": "8e1c75ec0aaf938fb328165209dbb9e2",
"content-hash": "725640e42155cd1f599ef3cc504ee22f", "content-hash": "aa8d6a47717887456a0066a1320811e0",
"packages": [ "packages": [
{ {
"name": "bantu/ini-get-wrapper", "name": "bantu/ini-get-wrapper",
@ -1143,27 +1143,27 @@
}, },
{ {
"name": "s9e/text-formatter", "name": "s9e/text-formatter",
"version": "0.11.2", "version": "0.13.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/s9e/TextFormatter.git", "url": "https://github.com/s9e/TextFormatter.git",
"reference": "735a56076e29348d838ce6c2658996daae86718f" "reference": "804ed8fdfa9fd0c8d99f5a33000d4f7e5ed90c6f"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/s9e/TextFormatter/zipball/735a56076e29348d838ce6c2658996daae86718f", "url": "https://api.github.com/repos/s9e/TextFormatter/zipball/804ed8fdfa9fd0c8d99f5a33000d4f7e5ed90c6f",
"reference": "735a56076e29348d838ce6c2658996daae86718f", "reference": "804ed8fdfa9fd0c8d99f5a33000d4f7e5ed90c6f",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"ext-dom": "*", "ext-dom": "*",
"ext-filter": "*", "ext-filter": "*",
"lib-pcre": ">=7.2", "lib-pcre": ">=7.2",
"php": ">=5.3.3" "php": ">=5.4.7"
}, },
"require-dev": { "require-dev": {
"matthiasmullie/minify": "*", "matthiasmullie/minify": "*",
"php": ">=5.3.3", "php": ">=5.4.7",
"s9e/regexp-builder": ">=1.3.0" "s9e/regexp-builder": ">=1.3.0"
}, },
"suggest": { "suggest": {
@ -1204,7 +1204,7 @@
"parser", "parser",
"shortcodes" "shortcodes"
], ],
"time": "2017-10-02 16:58:51" "time": "2017-12-10 00:55:53"
}, },
{ {
"name": "seld/cli-prompt", "name": "seld/cli-prompt",

View file

@ -266,7 +266,8 @@ class factory implements \phpbb\textformatter\cache_interface
->addParameterByName('logger') ->addParameterByName('logger')
->addParameterByName('max_img_height') ->addParameterByName('max_img_height')
->addParameterByName('max_img_width') ->addParameterByName('max_img_width')
->markAsSafeAsURL(); ->markAsSafeAsURL()
->setJS('UrlFilter.filter');
// Add default BBCodes // Add default BBCodes
foreach ($this->get_default_bbcodes($configurator) as $bbcode) foreach ($this->get_default_bbcodes($configurator) as $bbcode)
@ -355,8 +356,6 @@ class factory implements \phpbb\textformatter\cache_interface
$configurator->registeredVars['max_img_width'] = 0; $configurator->registeredVars['max_img_width'] = 0;
// Load the Emoji plugin and modify its tag's template to obey viewsmilies // Load the Emoji plugin and modify its tag's template to obey viewsmilies
$configurator->Emoji->omitImageSize();
$configurator->Emoji->useSVG();
$tag = $configurator->Emoji->getTag(); $tag = $configurator->Emoji->getTag();
$tag->template = '<xsl:choose><xsl:when test="$S_VIEWSMILIES">' . str_replace('class="emoji"', 'class="emoji smilies"', $tag->template) . '</xsl:when><xsl:otherwise><xsl:value-of select="."/></xsl:otherwise></xsl:choose>'; $tag->template = '<xsl:choose><xsl:when test="$S_VIEWSMILIES">' . str_replace('class="emoji"', 'class="emoji smilies"', $tag->template) . '</xsl:when><xsl:otherwise><xsl:value-of select="."/></xsl:otherwise></xsl:choose>';

View file

@ -13,7 +13,7 @@
namespace phpbb\textformatter\s9e; namespace phpbb\textformatter\s9e;
use s9e\TextFormatter\Parser\BuiltInFilters; use s9e\TextFormatter\Parser\AttributeFilters\UrlFilter;
use s9e\TextFormatter\Parser\Logger; use s9e\TextFormatter\Parser\Logger;
/** /**
@ -196,7 +196,7 @@ class parser implements \phpbb\textformatter\parser_interface
public function get_errors() public function get_errors()
{ {
$errors = array(); $errors = array();
foreach ($this->parser->getLogger()->get() as $entry) foreach ($this->parser->getLogger()->getLogs() as $entry)
{ {
list(, $msg, $context) = $entry; list(, $msg, $context) = $entry;
@ -365,7 +365,7 @@ class parser implements \phpbb\textformatter\parser_interface
static public function filter_img_url($url, array $url_config, Logger $logger, $max_height, $max_width) static public function filter_img_url($url, array $url_config, Logger $logger, $max_height, $max_width)
{ {
// Validate the URL // Validate the URL
$url = BuiltInFilters::filterUrl($url, $url_config, $logger); $url = UrlFilter::filter($url, $url_config, $logger);
if ($url === false) if ($url === false)
{ {
return false; return false;

View file

@ -50,27 +50,27 @@ class phpbb_textformatter_s9e_default_formatting_test extends phpbb_test_case
return array( return array(
array( array(
'[b]bold[/b]', '[b]bold[/b]',
'<span style="font-weight: bold">bold</span>' '<span style="font-weight:bold">bold</span>'
), ),
array( array(
'[u]underlined[/u]', '[u]underlined[/u]',
'<span style="text-decoration: underline">underlined</span>' '<span style="text-decoration:underline">underlined</span>'
), ),
array( array(
'[i]italic[/i]', '[i]italic[/i]',
'<span style="font-style: italic">italic</span>' '<span style="font-style:italic">italic</span>'
), ),
array( array(
'[color=#FF0000]colored[/color]', '[color=#FF0000]colored[/color]',
'<span style="color: #FF0000">colored</span>' '<span style="color:#FF0000">colored</span>'
), ),
array( array(
'[color=red]colored[/color]', '[color=red]colored[/color]',
'<span style="color: red">colored</span>' '<span style="color:red">colored</span>'
), ),
array( array(
'[size=75]smaller[/size]', '[size=75]smaller[/size]',
'<span style="font-size: 75%; line-height: normal">smaller</span>' '<span style="font-size:75%;line-height:normal">smaller</span>'
), ),
array( array(
'[quote]quoted[/quote]', '[quote]quoted[/quote]',
@ -102,31 +102,31 @@ class phpbb_textformatter_s9e_default_formatting_test extends phpbb_test_case
), ),
array( array(
'[list=1][*]item[/list]', '[list=1][*]item[/list]',
'<ol style="list-style-type: decimal"><li>item</li></ol>' '<ol style="list-style-type:decimal"><li>item</li></ol>'
), ),
array( array(
'[list=a][*]item[/list]', '[list=a][*]item[/list]',
'<ol style="list-style-type: lower-alpha"><li>item</li></ol>' '<ol style="list-style-type:lower-alpha"><li>item</li></ol>'
), ),
array( array(
'[list=i][*]item[/list]', '[list=i][*]item[/list]',
'<ol style="list-style-type: lower-roman"><li>item</li></ol>' '<ol style="list-style-type:lower-roman"><li>item</li></ol>'
), ),
array( array(
'[list=I][*]item[/list]', '[list=I][*]item[/list]',
'<ol style="list-style-type: upper-roman"><li>item</li></ol>' '<ol style="list-style-type:upper-roman"><li>item</li></ol>'
), ),
array( array(
'[list=disc][*]item[/list]', '[list=disc][*]item[/list]',
'<ul style="list-style-type: disc"><li>item</li></ul>' '<ul style="list-style-type:disc"><li>item</li></ul>'
), ),
array( array(
'[list=circle][*]item[/list]', '[list=circle][*]item[/list]',
'<ul style="list-style-type: circle"><li>item</li></ul>' '<ul style="list-style-type:circle"><li>item</li></ul>'
), ),
array( array(
'[list=square][*]item[/list]', '[list=square][*]item[/list]',
'<ul style="list-style-type: square"><li>item</li></ul>' '<ul style="list-style-type:square"><li>item</li></ul>'
), ),
array( array(
'[img]https://area51.phpbb.com/images/area51.png[/img]', '[img]https://area51.phpbb.com/images/area51.png[/img]',
@ -180,17 +180,17 @@ class phpbb_textformatter_s9e_default_formatting_test extends phpbb_test_case
array( array(
// Allow textual bbcodes in textual bbcodes // Allow textual bbcodes in textual bbcodes
'[b]bold [i]bold + italic[/i][/b]', '[b]bold [i]bold + italic[/i][/b]',
'<span style="font-weight: bold">bold <span style="font-style: italic">bold + italic</span></span>' '<span style="font-weight:bold">bold <span style="font-style:italic">bold + italic</span></span>'
), ),
array( array(
// Allow textual bbcodes in url with description // Allow textual bbcodes in url with description
'[url=https://area51.phpbb.com/]Area51 [i]italic[/i][/url]', '[url=https://area51.phpbb.com/]Area51 [i]italic[/i][/url]',
'<a href="https://area51.phpbb.com/" class="postlink">Area51 <span style="font-style: italic">italic</span></a>' '<a href="https://area51.phpbb.com/" class="postlink">Area51 <span style="font-style:italic">italic</span></a>'
), ),
array( array(
// Allow url with description in textual bbcodes // Allow url with description in textual bbcodes
'[i]italic [url=https://area51.phpbb.com/]Area51[/url][/i]', '[i]italic [url=https://area51.phpbb.com/]Area51[/url][/i]',
'<span style="font-style: italic">italic <a href="https://area51.phpbb.com/" class="postlink">Area51</a></span>' '<span style="font-style:italic">italic <a href="https://area51.phpbb.com/" class="postlink">Area51</a></span>'
), ),
array( array(
// Do not parse textual bbcodes in code // Do not parse textual bbcodes in code
@ -205,7 +205,7 @@ class phpbb_textformatter_s9e_default_formatting_test extends phpbb_test_case
array( array(
// Textual bbcode nesting into textual bbcode // Textual bbcode nesting into textual bbcode
'[b]bold [i]bold + italic[/b] italic[/i]', '[b]bold [i]bold + italic[/b] italic[/i]',
'<span style="font-weight: bold">bold <span style="font-style: italic">bold + italic</span></span><span style="font-style: italic"> italic</span>' '<span style="font-weight:bold">bold <span style="font-style:italic">bold + italic</span></span><span style="font-style:italic"> italic</span>'
), ),
array( array(
"[code]\tline1\n line2[/code]", "[code]\tline1\n line2[/code]",
@ -298,7 +298,7 @@ class phpbb_textformatter_s9e_default_formatting_test extends phpbb_test_case
), ),
array( array(
"Emoji: \xF0\x9F\x98\x80", "Emoji: \xF0\x9F\x98\x80",
'Emoji: <img alt="' . "\xF0\x9F\x98\x80" . '" class="emoji smilies" draggable="false" src="//cdn.jsdelivr.net/emojione/assets/svg/1f600.svg">' 'Emoji: <img alt="' . "\xF0\x9F\x98\x80" . '" class="emoji smilies" draggable="false" src="//cdn.jsdelivr.net/emojione/assets/3.1/png/64/1f600.png">'
), ),
array( array(
"Emoji: \xF0\x9F\x98\x80", "Emoji: \xF0\x9F\x98\x80",

View file

@ -1 +1 @@
<ul style="list-style-type: none"><li>This is my indented text</li></ul> <ul style="list-style-type:none"><li>This is my indented text</li></ul>

View file

@ -1,4 +1,4 @@
<blockquote><div><cite><a href="http://phpbb.com" class="postlink">http://phpbb.com</a> wrote:</cite>...</div></blockquote> <blockquote><div><cite><a href="http://phpbb.com" class="postlink">http://phpbb.com</a> wrote:</cite>...</div></blockquote>
<blockquote><div><cite><a href="http://phpbb.com" class="postlink"> http://phpbb.com</a> wrote:</cite>...</div></blockquote> <blockquote><div><cite><a href="http://phpbb.com" class="postlink"> http://phpbb.com</a> wrote:</cite>...</div></blockquote>
<span style="font-weight: bold"><a href="http://phpbb.com" class="postlink">http://phpbb.com</a></span><br> <span style="font-weight:bold"><a href="http://phpbb.com" class="postlink">http://phpbb.com</a></span><br>
<span style="font-weight: bold"> <a href="http://phpbb.com" class="postlink">http://phpbb.com</a></span><br> <span style="font-weight:bold"> <a href="http://phpbb.com" class="postlink">http://phpbb.com</a></span><br>

View file

@ -1 +1 @@
<code>[color=#FF0000]</code> - <span style="color: #FF0000">red</span> <code>[color=#FF0000]</code> - <span style="color:#FF0000">red</span>

View file

@ -1 +1 @@
<span style="font-size: 200%; line-height: normal"></span><div style="text-align:center"><span style="font-size: 200%; line-height: normal">xxx</span></div> <span style="font-size:200%;line-height:normal"></span><div style="text-align:center"><span style="font-size:200%;line-height:normal">xxx</span></div>

View file

@ -1 +1 @@
<ul><li><ol style="list-style-type: lower-alpha"><li>a</li><li>b</li><li>c</li><li>d</li><li>e</li></ol></li><li>outer</li></ul> <ul><li><ol style="list-style-type:lower-alpha"><li>a</li><li>b</li><li>c</li><li>d</li><li>e</li></ol></li><li>outer</li></ul>

View file

@ -1,4 +1,4 @@
<span style="color: #0000FF"></span><ul><li><span style="color: #0000FF">text</span></li> <span style="color:#0000FF"></span><ul><li><span style="color:#0000FF">text</span></li>
<li><span style="color: #0000FF">text</span></li> <li><span style="color:#0000FF">text</span></li>
<li><span style="color: #0000FF">text</span></li> <li><span style="color:#0000FF">text</span></li>
<li><span style="color: #0000FF">text</span></li></ul> <li><span style="color:#0000FF">text</span></li></ul>

View file

@ -1 +1 @@
<div style="padding: .2em .5em; font-size: .8em; width: 200px; background: #FFD;">moderator text<div style="font-weight: bold; text-align: right">- Mickroz</div></div> <div style="padding:.2em .5em;font-size:.8em;width:200px;background:#ffd">moderator text<div style="font-weight:bold;text-align:right">- Mickroz</div></div>

View file

@ -1 +1 @@
<img class="smilies" src="phpBB/images/smilies/icon_e_surprised.gif" width="15" height="17" alt=":o" title="First half of :ok:"> <img class="smilies" src="phpBB/images/smilies/icon_lol.gif" width="15" height="17" alt="k:" title="Second half of :ok:"> <img alt=":ok:" class="emoji smilies" draggable="false" src="//cdn.jsdelivr.net/emojione/assets/svg/1f197.svg"> <img class="smilies" src="phpBB/images/smilies/icon_e_surprised.gif" width="15" height="17" alt=":o" title="First half of :ok:"> <img class="smilies" src="phpBB/images/smilies/icon_lol.gif" width="15" height="17" alt="k:" title="Second half of :ok:"> <img alt=":ok:" class="emoji smilies" draggable="false" src="//cdn.jsdelivr.net/emojione/assets/3.1/png/64/1f197.png">

View file

@ -1 +1 @@
<span style="font-style: italic"><span style="font-weight: bold"><span style="color: #FF0000"></span></span></span>przykład <span style="font-style:italic"><span style="font-weight:bold"><span style="color:red"></span></span></span>przykład