Commit 2baa62ab authored by Christian Kuhn's avatar Christian Kuhn
Browse files

[BUGFIX] Use lolli42/finediff over cogpowered/finediff

finediff is used in various core places to render
a HTML "diff" view of two strings. The library didn't
see changes since 2014. With PHP 8.1, it started mumbling
about \ArrayAccess signature shenanigans.

We forked the lib to lolli42/finediff as drop-in
replacement, modernized the codebase a bit and added
multibyte support along the way - that's the reason this
patch is a bug fix.

composer req lolli42/finediff:^1.0
composer rem cogpowered/finediff
composer req lolli42/finediff:^1.0 -d typo3/sysext/core --no-update
composer rem cogpowered/finediff -d typo3/sysext/core --no-update

Change-Id: Ib00b8073253709459b56e3080d9361c46f913e4c
Resolves: #95742
Releases: master
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/71945


Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
Tested-by: Simon Gilli's avatarSimon Gilli <typo3@gilbertsoft.org>
Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: Simon Gilli's avatarSimon Gilli <typo3@gilbertsoft.org>
Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
parent 526f8a9f
......@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "d30fdfacaa03b12ca94e7953ae6970e8",
"content-hash": "2830fc16acead302b0369c3dadbaecd7",
"packages": [
{
"name": "bacon/bacon-qr-code",
......@@ -118,61 +118,6 @@
},
"time": "2021-02-26T10:19:33+00:00"
},
{
"name": "cogpowered/finediff",
"version": "0.3.1",
"source": {
"type": "git",
"url": "https://github.com/cogpowered/FineDiff.git",
"reference": "339ddc8c3afb656efed4f2f0a80e5c3d026f8ea8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/cogpowered/FineDiff/zipball/339ddc8c3afb656efed4f2f0a80e5c3d026f8ea8",
"reference": "339ddc8c3afb656efed4f2f0a80e5c3d026f8ea8",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"require-dev": {
"mockery/mockery": "*",
"phpunit/phpunit": "*"
},
"type": "library",
"autoload": {
"psr-0": {
"cogpowered\\FineDiff": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Rob Crowe",
"email": "rob@cogpowered.com"
},
{
"name": "Raymond Hill"
}
],
"description": "PHP implementation of a Fine granularity Diff engine",
"homepage": "https://github.com/cogpowered/FineDiff",
"keywords": [
"diff",
"finediff",
"opcode",
"string",
"text"
],
"support": {
"issues": "https://github.com/cogpowered/FineDiff/issues",
"source": "https://github.com/cogpowered/FineDiff/tree/master"
},
"time": "2014-05-19T10:25:02+00:00"
},
{
"name": "dasprid/enum",
"version": "1.0.3",
......@@ -1118,6 +1063,71 @@
},
"time": "2021-06-30T20:03:07+00:00"
},
{
"name": "lolli42/finediff",
"version": "1.0.0",
"source": {
"type": "git",
"url": "https://github.com/lolli42/FineDiff.git",
"reference": "249e4965bb6b7efe4c198021f38d6b31d93c4152"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/lolli42/FineDiff/zipball/249e4965bb6b7efe4c198021f38d6b31d93c4152",
"reference": "249e4965bb6b7efe4c198021f38d6b31d93c4152",
"shasum": ""
},
"require": {
"php": ">=7.2.0",
"symfony/polyfill-mbstring": "^1.23"
},
"replace": {
"cogpowered/finediff": "*"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.2",
"phpstan/phpstan": "^0.12.99",
"phpunit/phpunit": "^8 || ^9"
},
"type": "library",
"autoload": {
"psr-4": {
"cogpowered\\FineDiff\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Raymond Hill"
},
{
"name": "Rob Crowe",
"email": "rob@cogpowered.com"
},
{
"name": "Christian Kuhn",
"email": "lolli@schwarzbu.ch",
"role": "maintainer"
}
],
"description": "PHP implementation of a Fine granularity Diff engine",
"homepage": "https://github.com/lolli42/FineDiff",
"keywords": [
"diff",
"finediff",
"opcode",
"string",
"text"
],
"support": {
"issues": "https://github.com/lolli42/FineDiff/issues",
"source": "https://github.com/lolli42/FineDiff/tree/1.0.0"
},
"time": "2021-10-23T16:02:24+00:00"
},
{
"name": "masterminds/html5",
"version": "2.7.5",
......
......@@ -134,7 +134,7 @@
</tr>
<tr>
<td>FineDiff</td>
<td><a href="https://github.com/cogpowered/FineDiff" target="_blank" rel="noreferrer">github.com</a></td>
<td><a href="https://github.com/lolli42/FineDiff" target="_blank" rel="noreferrer">github.com</a></td>
</tr>
<tr>
<td>IDNA Convert</td>
......
......@@ -44,6 +44,6 @@ class DiffUtility
$str2 = strip_tags($str2);
}
$diff = new Diff(new Word());
return $diff->render($str1, $str2);
return $diff->render((string)$str1, (string)$str2);
}
}
......@@ -30,7 +30,6 @@
"composer-runtime-api": "^2.1",
"bacon/bacon-qr-code": "^2.0",
"christian-riesen/base32": "^1.6",
"cogpowered/finediff": "~0.3.1",
"doctrine/annotations": "^1.11",
"doctrine/dbal": "^2.13.4",
"doctrine/event-manager": "^1.0.0",
......@@ -40,6 +39,7 @@
"enshrined/svg-sanitize": "^0.14.1",
"guzzlehttp/guzzle": "^7.3.0",
"guzzlehttp/psr7": "^1.7.0 || ^2.0",
"lolli42/finediff": "^1.0",
"masterminds/html5": "^2.7",
"nikic/php-parser": "^4.10.4",
"psr/container": "^1.1 || ^2.0",
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment