From ebef8c225ea71cd44bece9d1ff5f5ff93b6bed9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9drix?= Date: Tue, 19 May 2026 22:45:45 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20conflit=20de=20variable=20$ips=20dans=20?= =?UTF-8?q?stats()=20=C3=A9crase=20le=20top=20IPs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Le foreach artIp30 utilisait $ips comme variable de boucle, écrasant le tableau de comptage des requêtes par IP. Résultat : ips=['66.249…':true] au lieu des vrais top 200 IPs. Renommé en $_artIpSet. Co-Authored-By: Claude Sonnet 4.6 --- CHANGELOG.md | 7 +++++++ public/version.txt | 2 +- src/AccessLogParser.php | 4 ++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4801e36..f028ffa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ Format : [Keep a Changelog](https://keepachangelog.com/fr/1.0.0/) — versionnag --- +## [1.6.36] - 2026-05-19 + +### Corrigé +- AccessLogParser : `foreach ($this->artIp30 as $path => $ips)` écrasait la variable locale `$ips` (top IPs par volume), la remplaçant par le dernier ensemble d'IPs d'article. Renommé en `$_artIpSet`. + +--- + ## [1.6.35] - 2026-05-19 ### Corrigé diff --git a/public/version.txt b/public/version.txt index e7b0418..74710e7 100644 --- a/public/version.txt +++ b/public/version.txt @@ -1 +1 @@ -1.6.35 +1.6.36 diff --git a/src/AccessLogParser.php b/src/AccessLogParser.php index 80219cd..427d2c5 100644 --- a/src/AccessLogParser.php +++ b/src/AccessLogParser.php @@ -161,11 +161,11 @@ class AccessLogParser // Visiteurs uniques par article (IPs publiques non-bot, /post/ statut 200) $articleUv = []; - foreach ($this->artIp30 as $path => $ips) { + foreach ($this->artIp30 as $path => $_artIpSet) { $articleUv[$path] = [ '7' => count($this->artIp7[$path] ?? []), '14' => count($this->artIp14[$path] ?? []), - '30' => count($ips), + '30' => count($_artIpSet), ]; }