[ticket/15921] Updated dependencies to latest textformatter

PHPBB3-15921
This commit is contained in:
JoshyPHP 2018-12-24 02:27:45 +01:00 committed by Marc Alexander
parent 95424f1b98
commit 31c0466815
No known key found for this signature in database
GPG key ID: 50E0D2423696F995
5 changed files with 26 additions and 32 deletions

View file

@ -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.13.0", "s9e/text-formatter": "^1.3",
"symfony/config": "^2.8", "symfony/config": "^2.8",
"symfony/console": "^2.8", "symfony/console": "^2.8",
"symfony/debug": "^2.8", "symfony/debug": "^2.8",

27
phpBB/composer.lock generated
View file

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "c843abc1344cd9df37f63c08a125cad0", "content-hash": "6daa2f5f7a161377dee1835bd4d5b463",
"packages": [ "packages": [
{ {
"name": "bantu/ini-get-wrapper", "name": "bantu/ini-get-wrapper",
@ -342,7 +342,7 @@
"oauth", "oauth",
"security" "security"
], ],
"time": "2016-07-12T22:15:00+00:00" "time": "2018-02-14T22:37:14+00:00"
}, },
{ {
"name": "marc1706/fast-image-size", "name": "marc1706/fast-image-size",
@ -505,7 +505,7 @@
"pseudorandom", "pseudorandom",
"random" "random"
], ],
"time": "2017-03-13T16:22:52+00:00" "time": "2018-04-04T21:48:54+00:00"
}, },
{ {
"name": "patchwork/utf8", "name": "patchwork/utf8",
@ -661,16 +661,16 @@
}, },
{ {
"name": "s9e/text-formatter", "name": "s9e/text-formatter",
"version": "0.13.1", "version": "1.3.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/s9e/TextFormatter.git", "url": "https://github.com/s9e/TextFormatter.git",
"reference": "804ed8fdfa9fd0c8d99f5a33000d4f7e5ed90c6f" "reference": "640b65b0d4c1de93bc98000c003998c08b2e7256"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/s9e/TextFormatter/zipball/804ed8fdfa9fd0c8d99f5a33000d4f7e5ed90c6f", "url": "https://api.github.com/repos/s9e/TextFormatter/zipball/640b65b0d4c1de93bc98000c003998c08b2e7256",
"reference": "804ed8fdfa9fd0c8d99f5a33000d4f7e5ed90c6f", "reference": "640b65b0d4c1de93bc98000c003998c08b2e7256",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -681,8 +681,8 @@
}, },
"require-dev": { "require-dev": {
"matthiasmullie/minify": "*", "matthiasmullie/minify": "*",
"php": ">=5.4.7", "php-coveralls/php-coveralls": "*",
"s9e/regexp-builder": ">=1.3.0" "s9e/regexp-builder": "1.*"
}, },
"suggest": { "suggest": {
"ext-curl": "Improves the performance of the MediaEmbed plugin and some JavaScript minifiers", "ext-curl": "Improves the performance of the MediaEmbed plugin and some JavaScript minifiers",
@ -722,7 +722,7 @@
"parser", "parser",
"shortcodes" "shortcodes"
], ],
"time": "2017-12-10T00:55:53+00:00" "time": "2018-12-23T20:27:39+00:00"
}, },
{ {
"name": "symfony/config", "name": "symfony/config",
@ -2293,7 +2293,8 @@
"authors": [ "authors": [
{ {
"name": "Michiel Rook", "name": "Michiel Rook",
"email": "mrook@php.net" "email": "mrook@php.net",
"role": "Lead"
}, },
{ {
"name": "Phing Community", "name": "Phing Community",
@ -2891,9 +2892,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",

View file

@ -23,14 +23,16 @@ class link_helper
* *
* @param \s9e\TextFormatter\Parser\Tag $tag LINK_TEXT tag * @param \s9e\TextFormatter\Parser\Tag $tag LINK_TEXT tag
* @param \s9e\TextFormatter\Parser $parser Parser * @param \s9e\TextFormatter\Parser $parser Parser
* @return bool Whether the tag is valid * @return void
*/ */
public function cleanup_tag(\s9e\TextFormatter\Parser\Tag $tag, \s9e\TextFormatter\Parser $parser) public function cleanup_tag(\s9e\TextFormatter\Parser\Tag $tag, \s9e\TextFormatter\Parser $parser)
{ {
// Invalidate if the content of the tag matches the text attribute // Invalidate if the content of the tag matches the text attribute
$text = substr($parser->getText(), $tag->getPos(), $tag->getLen()); $text = substr($parser->getText(), $tag->getPos(), $tag->getLen());
if ($text === $tag->getAttribute('text'))
return ($text !== $tag->getAttribute('text')); {
$tag->invalidate();
}
} }
/** /**
@ -40,7 +42,7 @@ class link_helper
* *
* @param \s9e\TextFormatter\Parser\Tag $tag URL tag (start tag) * @param \s9e\TextFormatter\Parser\Tag $tag URL tag (start tag)
* @param \s9e\TextFormatter\Parser $parser Parser * @param \s9e\TextFormatter\Parser $parser Parser
* @return bool Always true to indicate that the tag is valid * @return void
*/ */
public function generate_link_text_tag(\s9e\TextFormatter\Parser\Tag $tag, \s9e\TextFormatter\Parser $parser) public function generate_link_text_tag(\s9e\TextFormatter\Parser\Tag $tag, \s9e\TextFormatter\Parser $parser)
{ {
@ -49,7 +51,7 @@ class link_helper
// the [url] BBCode when its content is used for the URL // the [url] BBCode when its content is used for the URL
if (!$tag->getEndTag() || !$this->should_shorten($tag, $parser->getText())) if (!$tag->getEndTag() || !$this->should_shorten($tag, $parser->getText()))
{ {
return true; return;
} }
// Capture the text between the start tag and its end tag // Capture the text between the start tag and its end tag
@ -60,8 +62,6 @@ class link_helper
// Create a tag that consumes the link's text // Create a tag that consumes the link's text
$parser->addSelfClosingTag('LINK_TEXT', $start, $length)->setAttribute('text', $text); $parser->addSelfClosingTag('LINK_TEXT', $start, $length)->setAttribute('text', $text);
return true;
} }
/** /**
@ -84,7 +84,7 @@ class link_helper
* *
* @param \s9e\TextFormatter\Parser\Tag $tag LINK_TEXT tag * @param \s9e\TextFormatter\Parser\Tag $tag LINK_TEXT tag
* @param string $board_url Forum's root URL (with trailing slash) * @param string $board_url Forum's root URL (with trailing slash)
* @return bool Always true to indicate that the tag is valid * @return void
*/ */
public function truncate_local_url(\s9e\TextFormatter\Parser\Tag $tag, $board_url) public function truncate_local_url(\s9e\TextFormatter\Parser\Tag $tag, $board_url)
{ {
@ -93,15 +93,13 @@ class link_helper
{ {
$tag->setAttribute('text', substr($text, strlen($board_url))); $tag->setAttribute('text', substr($text, strlen($board_url)));
} }
return true;
} }
/** /**
* Truncate the replacement text set in a LINK_TEXT tag * Truncate the replacement text set in a LINK_TEXT tag
* *
* @param \s9e\TextFormatter\Parser\Tag $tag LINK_TEXT tag * @param \s9e\TextFormatter\Parser\Tag $tag LINK_TEXT tag
* @return bool Always true to indicate that the tag is valid * @return void
*/ */
public function truncate_text(\s9e\TextFormatter\Parser\Tag $tag) public function truncate_text(\s9e\TextFormatter\Parser\Tag $tag)
{ {
@ -109,10 +107,7 @@ class link_helper
if (utf8_strlen($text) > 55) if (utf8_strlen($text) > 55)
{ {
$text = utf8_substr($text, 0, 39) . ' ... ' . utf8_substr($text, -10); $text = utf8_substr($text, 0, 39) . ' ... ' . utf8_substr($text, -10);
$tag->setAttribute('text', $text);
} }
$tag->setAttribute('text', $text);
return true;
} }
} }

View file

@ -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/3.1/png/64/1f600.png">' 'Emoji: <img alt="' . "\xF0\x9F\x98\x80" . '" class="emoji smilies" draggable="false" src="//cdn.jsdelivr.net/emojione/assets/4.0/png/64/1f600.png">'
), ),
array( array(
"Emoji: \xF0\x9F\x98\x80", "Emoji: \xF0\x9F\x98\x80",

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/3.1/png/64/1f197.png"> <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/4.0/png/64/1f197.png">