From 50fc319afd7fd3863833e552b390b9ce85e5222a Mon Sep 17 00:00:00 2001 From: F TEMPEZ Date: Thu, 22 Feb 2024 14:34:54 +0100 Subject: [PATCH] =?UTF-8?q?13.1.07=20Corrige=20une=20erreur=20de=20tri=20d?= =?UTF-8?q?ans=20RFM=20d=C3=A9pr=C3=A9ciation=20return=20usort?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGES.md | 7 ++++++ LISEZMOI.md | 2 +- README.md | 2 +- core/core.php | 2 +- core/vendor/filemanager/dialog.php | 38 +++++++++++++++++------------- 5 files changed, 31 insertions(+), 20 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 0353d8b0..e25deb4d 100755 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,12 @@ # Changelog + +## Version 13.1.07 + +### Corrections + +- Corrige une dépréciation de la sortie de la fonction Usort dans RFM. + ## Version 13.1.06 ### Corrections diff --git a/LISEZMOI.md b/LISEZMOI.md index 82858e74..54bcaaff 100644 --- a/LISEZMOI.md +++ b/LISEZMOI.md @@ -1,4 +1,4 @@ -# ZwiiCMS 13.1.06 +# ZwiiCMS 13.1.07 Zwii est un CMS sans base de données (flat-file) qui permet de créer et gérer facilement un site web sans aucune connaissance en programmation. diff --git a/README.md b/README.md index 7da0e59c..dc905856 100755 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# ZwiiCMS 13.1.06 +# ZwiiCMS 13.1.07 Zwii is a database-less (flat-file) CMS that allows you to easily create and manage a web site without any programming knowledge. diff --git a/core/core.php b/core/core.php index b8aa902e..cd2b9aa9 100644 --- a/core/core.php +++ b/core/core.php @@ -51,7 +51,7 @@ class common const ACCESS_TIMER = 1800; // Numéro de version - const ZWII_VERSION = '13.1.06'; + const ZWII_VERSION = '13.1.07'; // URL autoupdate const ZWII_UPDATE_URL = 'https://forge.chapril.org/ZwiiCMS-Team/cms-update/raw/branch/master/'; diff --git a/core/vendor/filemanager/dialog.php b/core/vendor/filemanager/dialog.php index 151bc809..47a4ee33 100644 --- a/core/vendor/filemanager/dialog.php +++ b/core/vendor/filemanager/dialog.php @@ -864,50 +864,54 @@ if ($config['upload_files']) { ?> switch ($sort_by) { case 'date': - //usort($sorted, 'dateSort'); usort($sorted, function($x, $y) use ($descending) { if ($x['is_dir'] !== $y['is_dir']) { return $y['is_dir'] ? 1 : -1; } else { - return ($descending) - ? $x['size'] < $y['size'] - : $x['size'] >= $y['size']; + if ($descending) { + return ($x['size'] < $y['size']) ? -1 : ($x['size'] > $y['size'] ? 1 : 0); + } else { + return ($x['size'] > $y['size']) ? -1 : ($x['size'] < $y['size'] ? 1 : 0); + } } }); break; case 'size': - //usort($sorted, 'sizeSort'); usort($sorted, function($x, $y) use ($descending) { if ($x['is_dir'] !== $y['is_dir']) { return $y['is_dir'] ? 1 : -1; } else { - return ($descending) - ? $x['date'] < $y['date'] - : $x['date'] >= $y['date']; + if ($descending) { + return ($x['date'] < $y['date']) ? -1 : ($x['date'] > $y['date'] ? 1 : 0); + } else { + return ($x['date'] > $y['date']) ? -1 : ($x['date'] < $y['date'] ? 1 : 0); + } } }); - break; case 'extension': - //usort($sorted, 'extensionSort'); usort($sorted, function($x, $y) use ($descending) { if ($x['is_dir'] !== $y['is_dir']) { return $y['is_dir'] ? 1 : -1; } else { - return ($descending) - ? ($x['extension'] < $y['extension'] ? 1 : 0) - : ($x['extension'] >= $y['extension'] ? 1 : 0); + if ($descending) { + return strcasecmp($x['extension'], $y['extension']); + } else { + return -strcasecmp($x['extension'], $y['extension']); + } } }); + break; default: - // usort($sorted, 'filenameSort'); usort($sorted, function($x, $y) use ($descending) { if ($x['is_dir'] !== $y['is_dir']) { return $y['is_dir'] ? 1 : -1; } else { - return ($descending) - ? ($x['file_lcase'] < $y['file_lcase'] ? 1 : ($x['file_lcase'] == $y['file_lcase'] ? 0 : -1)) - : ($x['file_lcase'] >= $y['file_lcase'] ? 1 : ($x['file_lcase'] == $y['file_lcase'] ? 0 : -1)); + if ($descending) { + return strcasecmp($x['file_lcase'], $y['file_lcase']); + } else { + return -strcasecmp($x['file_lcase'], $y['file_lcase']); + } } }); break;