From c846dd56663e1608439abf5bd629b6a964478fa4 Mon Sep 17 00:00:00 2001 From: rxu Date: Mon, 19 Jul 2021 22:49:04 +0700 Subject: [PATCH] [ticket/16822] Replace patchwork/utf8 with symfony/polyfill PHPBB3-16822 --- phpBB/composer.json | 4 +- phpBB/composer.lock | 121 ++++++------------------------- phpBB/includes/utf/utf_tools.php | 8 +- 3 files changed, 28 insertions(+), 105 deletions(-) diff --git a/phpBB/composer.json b/phpBB/composer.json index c9b7cfcd21..a333e445f9 100644 --- a/phpBB/composer.json +++ b/phpBB/composer.json @@ -34,7 +34,6 @@ "guzzlehttp/guzzle": "~6.3", "lusitanian/oauth": "^0.8.1", "marc1706/fast-image-size": "^1.1", - "patchwork/utf8": "^1.1", "s9e/text-formatter": "^2.0", "symfony/config": "~3.4", "symfony/console": "~3.4", @@ -45,6 +44,9 @@ "symfony/finder": "~3.4", "symfony/http-foundation": "~3.4", "symfony/http-kernel": "~3.4", + "symfony/polyfill-intl-normalizer": "^1.23", + "symfony/polyfill-mbstring": "^1.23", + "symfony/polyfill-php72": "^1.23", "symfony/process": "^3.4", "symfony/proxy-manager-bridge": "~3.4", "symfony/routing": "~3.4", diff --git a/phpBB/composer.lock b/phpBB/composer.lock index dc26600910..7913bfa858 100644 --- a/phpBB/composer.lock +++ b/phpBB/composer.lock @@ -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": "aba28293c9c05523b3fb2f91dac53f17", + "content-hash": "c3b908b6821d39c16eba64f03090ddb7", "packages": [ { "name": "bantu/ini-get-wrapper", @@ -571,83 +571,6 @@ }, "time": "2017-05-04T11:12:50+00:00" }, - { - "name": "patchwork/utf8", - "version": "v1.3.3", - "source": { - "type": "git", - "url": "https://github.com/tchwork/utf8.git", - "reference": "e1fa4d4a57896d074c9a8d01742b688d5db4e9d5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/tchwork/utf8/zipball/e1fa4d4a57896d074c9a8d01742b688d5db4e9d5", - "reference": "e1fa4d4a57896d074c9a8d01742b688d5db4e9d5", - "shasum": "" - }, - "require": { - "lib-pcre": ">=7.3", - "php": ">=5.3.0" - }, - "require-dev": { - "symfony/phpunit-bridge": "^3.4|^4.4" - }, - "suggest": { - "ext-iconv": "Use iconv for best performance", - "ext-intl": "Use Intl for best performance", - "ext-mbstring": "Use Mbstring for best performance", - "ext-wfio": "Use WFIO for UTF-8 filesystem access on Windows" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3-dev" - } - }, - "autoload": { - "psr-4": { - "Patchwork\\": "src/Patchwork/" - }, - "classmap": [ - "src/Normalizer.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "(Apache-2.0 or GPL-2.0)" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - } - ], - "description": "Portable and performant UTF-8, Unicode and Grapheme Clusters for PHP", - "homepage": "https://github.com/tchwork/utf8", - "keywords": [ - "grapheme", - "i18n", - "unicode", - "utf-8", - "utf8" - ], - "support": { - "issues": "https://github.com/tchwork/utf8/issues", - "source": "https://github.com/tchwork/utf8/tree/v1.3.3" - }, - "funding": [ - { - "url": "https://github.com/nicolas-grekas", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/patchwork/utf8", - "type": "tidelift" - } - ], - "abandoned": "symfony/polyfill-mbstring or symfony/string", - "time": "2021-01-07T16:38:58+00:00" - }, { "name": "psr/container", "version": "1.0.0", @@ -1854,16 +1777,16 @@ }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.22.1", + "version": "v1.23.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "43a0283138253ed1d48d352ab6d0bdb3f809f248" + "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/43a0283138253ed1d48d352ab6d0bdb3f809f248", - "reference": "43a0283138253ed1d48d352ab6d0bdb3f809f248", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8590a5f561694770bdcd3f9b5c69dde6945028e8", + "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8", "shasum": "" }, "require": { @@ -1875,7 +1798,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.22-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1918,7 +1841,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.22.1" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.23.0" }, "funding": [ { @@ -1934,20 +1857,20 @@ "type": "tidelift" } ], - "time": "2021-01-22T09:19:47+00:00" + "time": "2021-02-19T12:13:01+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.22.1", + "version": "v1.23.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "5232de97ee3b75b0360528dae24e73db49566ab1" + "reference": "2df51500adbaebdc4c38dea4c89a2e131c45c8a1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/5232de97ee3b75b0360528dae24e73db49566ab1", - "reference": "5232de97ee3b75b0360528dae24e73db49566ab1", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/2df51500adbaebdc4c38dea4c89a2e131c45c8a1", + "reference": "2df51500adbaebdc4c38dea4c89a2e131c45c8a1", "shasum": "" }, "require": { @@ -1959,7 +1882,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.22-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1998,7 +1921,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.22.1" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.23.0" }, "funding": [ { @@ -2014,7 +1937,7 @@ "type": "tidelift" } ], - "time": "2021-01-22T09:19:47+00:00" + "time": "2021-05-27T09:27:20+00:00" }, { "name": "symfony/polyfill-php56", @@ -2154,16 +2077,16 @@ }, { "name": "symfony/polyfill-php72", - "version": "v1.22.1", + "version": "v1.23.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "cc6e6f9b39fe8075b3dabfbaf5b5f645ae1340c9" + "reference": "9a142215a36a3888e30d0a9eeea9766764e96976" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/cc6e6f9b39fe8075b3dabfbaf5b5f645ae1340c9", - "reference": "cc6e6f9b39fe8075b3dabfbaf5b5f645ae1340c9", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/9a142215a36a3888e30d0a9eeea9766764e96976", + "reference": "9a142215a36a3888e30d0a9eeea9766764e96976", "shasum": "" }, "require": { @@ -2172,7 +2095,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.22-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", @@ -2210,7 +2133,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php72/tree/v1.22.1" + "source": "https://github.com/symfony/polyfill-php72/tree/v1.23.0" }, "funding": [ { @@ -2226,7 +2149,7 @@ "type": "tidelift" } ], - "time": "2021-01-07T16:49:33+00:00" + "time": "2021-05-27T09:17:38+00:00" }, { "name": "symfony/process", diff --git a/phpBB/includes/utf/utf_tools.php b/phpBB/includes/utf/utf_tools.php index 359f691a52..5a1ca5b6fe 100644 --- a/phpBB/includes/utf/utf_tools.php +++ b/phpBB/includes/utf/utf_tools.php @@ -22,11 +22,9 @@ if (!defined('IN_PHPBB')) setlocale(LC_CTYPE, 'C'); /** -* Setup the UTF-8 portability layer -*/ -Patchwork\Utf8\Bootup::initUtf8Encode(); -Patchwork\Utf8\Bootup::initMbstring(); -Patchwork\Utf8\Bootup::initIntl(); + * UTF-8 portability layer is provided by + * symfony/polyfill-mbstring, symfony/polyfill-intl-normalizer, symfony/polyfill-php72 + */ /** * UTF-8 tools