From 79f3c61cac7cb32ea39040f89daab8707720fb60 Mon Sep 17 00:00:00 2001 From: Frank Harris Date: Tue, 11 Nov 2025 10:00:38 -0500 Subject: [PATCH] fixed BOM sorting issue --- modules/billing/docs.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/billing/docs.php b/modules/billing/docs.php index 2006631a..a917be83 100644 --- a/modules/billing/docs.php +++ b/modules/billing/docs.php @@ -49,7 +49,10 @@ function getDocCategories($docsDir) { } // Read metadata - $metadata = json_decode(file_get_contents($metadataPath), true); + $metadataContent = file_get_contents($metadataPath); + // Remove UTF-8 BOM if present + $metadataContent = preg_replace('/^\xEF\xBB\xBF/', '', $metadataContent); + $metadata = json_decode($metadataContent, true); if (!$metadata) { $metadata = []; } @@ -69,7 +72,7 @@ function getDocCategories($docsDir) { 'folder' => $folder, 'name' => $displayName, 'description' => $metadata['description'] ?? '', - 'category' => $metadata['category'] ?? 'other', + 'category' => trim($metadata['category'] ?? 'other'), 'order' => $metadata['order'] ?? 999, 'icon' => $icon ];