diff --git a/README.md b/README.md index aa1f6ab..27cc04a 100644 --- a/README.md +++ b/README.md @@ -8,10 +8,10 @@ For more information, go to https://www.luigifab.fr/openmage/versioning (IPv6 is This repository is a releases mirror. To install the module, please use the composer key available in the documentation. -- Current version: 4.4.2 (06/06/2022) +- Current version: 4.4.3 (07/07/2022) - Compatibility: OpenMage 19.x / 20.x / 21.x, PHP 7.2 / 7.3 / 7.4 / 8.0 / 8.1 - Client compatibility: Firefox 36+, Chrome 32+, Opera 19+, Edge 16+, Safari 9+ - Translations: English (en), French (fr-FR/fr-CA), German (de), Italian (it), Portuguese (pt-PT/pt-BR), Spanish (es) / Chinese (zh), Czech (cs), Dutch (nl), Greek (el), Hungarian (hu), Japanese (ja), Polish (pl), Romanian (ro), Russian (ru), Slovak (sk), Turkish (tr), Ukrainian (uk) - License: GNU GPL 2+ -If you like, take some of your time to improve the translations, go to https://bit.ly/2HyCCEc. \ No newline at end of file +If you like, take some of your time to improve the translations, go to https://bit.ly/2HyCCEc. diff --git a/composer.json b/composer.json index cbd4e91..116db79 100644 --- a/composer.json +++ b/composer.json @@ -29,6 +29,7 @@ "require": { "php": ">=7.2.0", "openmage/magento-lts": ">=19.4.0", + "symfony/polyfill-php80": "*", "ext-mbstring": "*", "ext-json": "*", "ext-curl": "*", diff --git a/src/app/code/community/Luigifab/Versioning/Block/Adminhtml/Config/Help.php b/src/app/code/community/Luigifab/Versioning/Block/Adminhtml/Config/Help.php index 313a6c3..64176f6 100644 --- a/src/app/code/community/Luigifab/Versioning/Block/Adminhtml/Config/Help.php +++ b/src/app/code/community/Luigifab/Versioning/Block/Adminhtml/Config/Help.php @@ -1,7 +1,7 @@ * https://www.luigifab.fr/openmage/versioning @@ -35,13 +35,13 @@ public function render(Varien_Data_Form_Element_Abstract $element) { protected function checkChanges() { $index = file_get_contents(getenv('SCRIPT_FILENAME') ?? BP.'/index.php'); - if (mb_strpos($index, '::f{4}:\\d{1,3}') === false) + if (!str_contains($index, '::f{4}:\\d{1,3}')) return 'index.php'; - if (mb_strpos($index, '? substr($ip, 7)') === false) + if (!str_contains($index, '? substr($ip, 7)')) return 'index.php'; - if (mb_strpos($index, '$ip = empty($ip) ? getenv(\'REMOTE_ADDR\')') === false) + if (!str_contains($index, '$ip = empty($ip) ? getenv(\'REMOTE_ADDR\')')) return 'index.php'; - if (mb_strpos($index, 'config/upgrade.ip') === false) + if (!str_contains($index, 'config/upgrade.ip')) return 'index.php'; return true; diff --git a/src/app/code/community/Luigifab/Versioning/Model/History.php b/src/app/code/community/Luigifab/Versioning/Model/History.php index 0ecc96e..7fa6b4a 100644 --- a/src/app/code/community/Luigifab/Versioning/Model/History.php +++ b/src/app/code/community/Luigifab/Versioning/Model/History.php @@ -1,7 +1,7 @@ * https://www.luigifab.fr/openmage/versioning @@ -35,9 +35,8 @@ public function init(int $page, int $size) { // construction d'un premier tableau $resource = fopen($file, 'rb'); - while (($line = fgetcsv($resource, 50000, ',', '`')) !== false) { + while (!empty($line = fgetcsv($resource, 50000, ',', '`'))) { - $line = (array) $line; // (yes) if (!empty($line[0])) { $item = new Varien_Object(); diff --git a/src/app/code/community/Luigifab/Versioning/Model/Observer.php b/src/app/code/community/Luigifab/Versioning/Model/Observer.php index 9b8d38f..ad0b564 100644 --- a/src/app/code/community/Luigifab/Versioning/Model/Observer.php +++ b/src/app/code/community/Luigifab/Versioning/Model/Observer.php @@ -1,7 +1,7 @@ * https://www.luigifab.fr/openmage/versioning @@ -149,7 +149,7 @@ protected function updateIpConfig(array $global) { continue; if (stripos($key, '_byip') !== false) { - $key = (string) substr($key, 0, strrpos($key, '_')); // (yes) + $key = substr($key, 0, strrpos($key, '_')); $value = array_filter(preg_split('#\s+#', $value)); $config[$key][] = '-'.implode("-\n-", $value).'-'; } diff --git a/src/app/code/community/Luigifab/Versioning/Model/Scm/Git.php b/src/app/code/community/Luigifab/Versioning/Model/Scm/Git.php index b8a38bd..3fb045b 100644 --- a/src/app/code/community/Luigifab/Versioning/Model/Scm/Git.php +++ b/src/app/code/community/Luigifab/Versioning/Model/Scm/Git.php @@ -1,7 +1,7 @@ * https://www.luigifab.fr/openmage/versioning @@ -193,9 +193,9 @@ public function getCurrentDiff($from = null, $to = null, $dir = null, $excl = nu // https://github.com/git/git/commit/296d4a94e7231a1d57356889f51bff57a1a3c5a1 (ignore-matching-lines) if (!empty($excl) && version_compare($this->getSoftwareVersion(), '2.30.0', '>=')) { - if (mb_strpos($excl, 'copyright') !== false) + if (str_contains($excl, 'copyright')) $command .= ' --ignore-matching-lines " Copyright 20[0-9][0-9]\-20[0-9][0-9]"'; - if (mb_strpos($excl, 'updatedat') !== false) + if (str_contains($excl, 'updatedat')) $command .= ' --ignore-matching-lines " Updated [A-Z]/[0-9][0-9]/[0-9][0-9]/[0-9][0-9][0-9][0-9]"'; } @@ -321,7 +321,7 @@ public function getCurrentDiffStatus($from = null, $to = null, $dir = null, $exc $lines[$i] = str_replace('M'."\t", "\t\t".str_replace('-', ' ', $help->__('modified:-------')), $line); } else if (mb_stripos($line, 'R') === 0) { - $tmp = (array) preg_split('#\s+#', $line); // (yes) + $tmp = preg_split('#\s+#', $line); if ((count($tmp) == 3) && (($pos = mb_strrpos($tmp[2], '/')) !== false) && (mb_stripos($tmp[1], mb_substr($tmp[2], 0, $pos)) === 0)) $line = $tmp[0]."\t".$tmp[1].' > '.mb_substr($tmp[2], $pos + 1); $lines[$i] = preg_replace("#R\d*\t#", "\t\t".str_replace('-', ' ', $help->__('renamed:--------')), $line); diff --git a/src/app/code/community/Luigifab/Versioning/etc/config.xml b/src/app/code/community/Luigifab/Versioning/etc/config.xml index 6ad47aa..bf7d572 100644 --- a/src/app/code/community/Luigifab/Versioning/etc/config.xml +++ b/src/app/code/community/Luigifab/Versioning/etc/config.xml @@ -1,7 +1,7 @@