From 5d4561bd0a5f333bc943dded9b4899b28de1b632 Mon Sep 17 00:00:00 2001 From: El RIDO Date: Thu, 13 Mar 2025 08:29:53 +0100 Subject: [PATCH] drop ctype requirement (only one use left) --- CHANGELOG.md | 1 + composer.json | 3 +- composer.lock | 93 +------ doc/Installation.md | 1 - lib/View.php | 2 +- vendor/composer/autoload_classmap.php | 2 +- vendor/composer/autoload_files.php | 1 - vendor/composer/autoload_psr4.php | 1 - vendor/composer/autoload_static.php | 8 +- vendor/composer/installed.php | 19 +- .../ip-lib/src/Address/AddressInterface.php | 26 ++ vendor/mlocati/ip-lib/src/Address/IPv4.php | 58 +++++ vendor/mlocati/ip-lib/src/Address/IPv6.php | 58 +++++ .../ip-lib/src/Range/AbstractRange.php | 45 ++++ vendor/mlocati/ip-lib/src/Range/Pattern.php | 6 +- .../ip-lib/src/Range/RangeInterface.php | 26 ++ vendor/mlocati/ip-lib/src/Range/Single.php | 22 +- vendor/mlocati/ip-lib/src/Range/Subnet.php | 5 +- vendor/symfony/polyfill-ctype/Ctype.php | 232 ------------------ vendor/symfony/polyfill-ctype/bootstrap.php | 50 ---- vendor/symfony/polyfill-ctype/bootstrap80.php | 46 ---- 21 files changed, 252 insertions(+), 453 deletions(-) delete mode 100644 vendor/symfony/polyfill-ctype/Ctype.php delete mode 100644 vendor/symfony/polyfill-ctype/bootstrap.php delete mode 100644 vendor/symfony/polyfill-ctype/bootstrap80.php diff --git a/CHANGELOG.md b/CHANGELOG.md index ce4408ee..8c987850 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## 1.7.7 (not yet released) * ADDED: Switching templates using the web ui (#1501) * CHANGED: Passing large data structures by reference to reduce memory consumption (#858) +* CHANGED: Removed use of ctype functions and polyfill library for ctype * CHANGED: Upgrading libraries to: ip-lib 1.20.0 ## 1.7.6 (2025-02-01) diff --git a/composer.json b/composer.json index 5188b14a..47aa2ef8 100644 --- a/composer.json +++ b/composer.json @@ -27,8 +27,7 @@ "php": "^7.3 || ^8.0", "jdenticon/jdenticon": "1.0.2", "mlocati/ip-lib": "1.20.0", - "symfony/polyfill-ctype": "^1.31", - "symfony/polyfill-php80": "^1.31", + "symfony/polyfill-php80": "1.31.0", "yzalis/identicon": "2.0.0" }, "suggest" : { diff --git a/composer.lock b/composer.lock index f1cedb0f..dfb58c46 100644 --- a/composer.lock +++ b/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": "b6e6a0433b36e6c81fcb3cb58b22a269", + "content-hash": "6c7e6dea19e8bfd5641b220cb68c4b65", "packages": [ { "name": "jdenticon/jdenticon", @@ -126,85 +126,6 @@ ], "time": "2025-02-04T17:30:58+00:00" }, - { - "name": "symfony/polyfill-ctype", - "version": "v1.31.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/a3cc8b044a6ea513310cbd48ef7333b384945638", - "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638", - "shasum": "" - }, - "require": { - "php": ">=7.2" - }, - "provide": { - "ext-ctype": "*" - }, - "suggest": { - "ext-ctype": "For best performance" - }, - "type": "library", - "extra": { - "thanks": { - "url": "https://github.com/symfony/polyfill", - "name": "symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for ctype functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "ctype", - "polyfill", - "portable" - ], - "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.31.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-09-09T11:45:10+00:00" - }, { "name": "symfony/polyfill-php80", "version": "v1.31.0", @@ -416,16 +337,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.12.1", + "version": "1.13.0", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845" + "reference": "024473a478be9df5fdaca2c793f2232fe788e414" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/123267b2c49fbf30d78a7b2d333f6be754b94845", - "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/024473a478be9df5fdaca2c793f2232fe788e414", + "reference": "024473a478be9df5fdaca2c793f2232fe788e414", "shasum": "" }, "require": { @@ -464,7 +385,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.12.1" + "source": "https://github.com/myclabs/DeepCopy/tree/1.13.0" }, "funding": [ { @@ -472,7 +393,7 @@ "type": "tidelift" } ], - "time": "2024-11-08T17:47:46+00:00" + "time": "2025-02-12T12:17:51+00:00" }, { "name": "nikic/php-parser", diff --git a/doc/Installation.md b/doc/Installation.md index f9f4fac5..57cf7622 100644 --- a/doc/Installation.md +++ b/doc/Installation.md @@ -22,7 +22,6 @@ for more information. ### Minimal Requirements - PHP version 7.3 or above -- ctype extension - GD extension (when using identicon or vizhash icons, jdenticon works without it) - zlib extension - some disk space or a database supported by [PDO](https://php.net/manual/book.pdo.php) diff --git a/lib/View.php b/lib/View.php index 958be833..666a03f7 100644 --- a/lib/View.php +++ b/lib/View.php @@ -70,7 +70,7 @@ class View $sri = array_key_exists($file, $this->_variables['SRI']) ? ' integrity="' . $this->_variables['SRI'][$file] . '"' : ''; // if the file isn't versioned (ends in a digit), add our own version - $cacheBuster = ctype_digit(substr($file, -4, 1)) ? + $cacheBuster = (bool) preg_match('#[0-9]\.js$#', (string) $file) ? '' : '?' . rawurlencode($this->_variables['VERSION']); echo '