isFile()) { $extension = strtolower($file->getExtension()); if (in_array($extension, ['jpg', 'jpeg', 'png', 'gif'])) { // Vérifier si l'image provient d'un dossier mature if (!isMatureContent($file->getPathname())) { $images[] = str_replace('\\', '/', $file->getPathname()); } } } } usort($images, function($a, $b) { return filectime($b) - filectime($a); }); return array_slice($images, 0, $limit); } $latestImages = getLatestImages(); ?>