fixed BOM sorting issue
This commit is contained in:
parent
498824ee98
commit
79f3c61cac
1 changed files with 5 additions and 2 deletions
|
|
@ -49,7 +49,10 @@ function getDocCategories($docsDir) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Read metadata
|
// 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) {
|
if (!$metadata) {
|
||||||
$metadata = [];
|
$metadata = [];
|
||||||
}
|
}
|
||||||
|
|
@ -69,7 +72,7 @@ function getDocCategories($docsDir) {
|
||||||
'folder' => $folder,
|
'folder' => $folder,
|
||||||
'name' => $displayName,
|
'name' => $displayName,
|
||||||
'description' => $metadata['description'] ?? '',
|
'description' => $metadata['description'] ?? '',
|
||||||
'category' => $metadata['category'] ?? 'other',
|
'category' => trim($metadata['category'] ?? 'other'),
|
||||||
'order' => $metadata['order'] ?? 999,
|
'order' => $metadata['order'] ?? 999,
|
||||||
'icon' => $icon
|
'icon' => $icon
|
||||||
];
|
];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue