From 818c83a99d1bfb30870d703106cb7d2f54599c45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois?= Date: Fri, 23 Oct 2026 17:56:20 +0200 Subject: [PATCH] fix faille --- src/Jirafeau/a.php | 63 +++++++++++++--------------- src/Jirafeau/c.php | 17 ++++---- src/Jirafeau/f.php | 4 +- src/Jirafeau/lib/attach-setup.php | 25 ++++++----- src/Jirafeau/lib/config.original.php | 2 + src/Jirafeau/lib/settings.php | 2 +- src/Jirafeau/lib/template/page.php | 2 +- src/Jirafeau/s.php | 13 ++---- 8 files changed, 57 insertions(+), 71 deletions(-) diff --git a/src/Jirafeau/a.php b/src/Jirafeau/a.php index 2b113c0..0a23b6e 100644 --- a/src/Jirafeau/a.php +++ b/src/Jirafeau/a.php @@ -13,7 +13,7 @@ action: a=login a=logout a=r[on|off] a=p[minute|hour|day|week|month|quarter|semester] */ -require ("lib/attach-setup.php"); +require (__DIR__ . "/lib/attach-setup.php"); $modeText = ['none' => "sans", 'footer' => "pied de page", 'attachment' => "pièce jointe", 'both' => "les deux"]; $trackText = ['on' => "oui", 'off' => "non"]; @@ -173,31 +173,24 @@ function period2seconds ($periodName) { switch ($periodName) { case 'minute': return JIRAFEAU_MINUTE; - break; case 'hour': return JIRAFEAU_HOUR; - break; case 'day': return JIRAFEAU_DAY; - break; case 'week': return JIRAFEAU_WEEK; - break; case 'month': return JIRAFEAU_MONTH; - break; case 'quarter': return JIRAFEAU_QUARTER; - break; case 'semester': return JIRAFEAU_SEMESTER; - break; case 'year': return JIRAFEAU_YEAR; - break; default: returnError (t ('ERR_OCC') . ' (periodName)'); } + return null; } // ======================================== @@ -266,7 +259,7 @@ function updateArchiveCacheUpTo ($period) { while ( ($d = array_shift ($stack)) && $d != null) { $dir = scandir ($d); foreach ($dir as $dirName) { - if (strcmp ($dirName, '.') == 0 || strcmp ($dirName, '..') == 0 || + if (strcmp ($dirName, '.') === 0 || strcmp ($dirName, '..') === 0 || preg_match ('/\.tmp/i', "$dirName")) { continue; } @@ -323,7 +316,7 @@ function readArchiveFromLines ($lines) { break; // XXX issue ")" case preg_match ("/^\s*new:\s*([0-9a-zA-Z_-]+)\s+([0-9a-zA-Z_-]+)\)?\s*$/", $line, $matches): - $archive [T_NEW][] = [$matches [1], $matches [2]]; + $archive [T_NEWKAZ][] = [$matches [1], $matches [2]]; break; case preg_match ("/^\s*old:\s*([0-9a-zA-Z_-]+)\s+([0-9a-zA-Z_-]+)\)?\s*$/", $line, $matches): $archive [T_OLD][] = [$matches [1], $matches [2]]; @@ -418,8 +411,8 @@ function deleteAction ($linkName) { return; } $fileToDelete = false; - if ($archiveInfo [T_NEW]) - foreach ($archiveInfo [T_NEW] as [$fileName, $cryptKey]) { + if ($archiveInfo [T_NEWKAZ]) + foreach ($archiveInfo [T_NEWKAZ] as [$fileName, $cryptKey]) { $fileLink = jirafeau_get_link ($fileName); if (! count ($fileLink)) continue; @@ -436,8 +429,8 @@ function deleteAction ($linkName) { $message .= "l'envoi ".$archiveInfo [T_TIME]." est supprimé"; if ($fileToDelete) $message .= " avec