diff --git a/engine/core/class/CodePressCMS.php b/engine/core/class/CodePressCMS.php index c6f3c3b..e4d6702 100644 --- a/engine/core/class/CodePressCMS.php +++ b/engine/core/class/CodePressCMS.php @@ -559,11 +559,12 @@ class CodePressCMS { // Remove file extensions (.md, .php, .html) from display names $filename = preg_replace('/\.(md|php|html)$/', '', $filename); - // Handle special cases first - if (strtolower($filename) === 'phpinfo') { + // Handle special cases first (only for exact filenames, not directories) + // These should only apply to actual files, not directory names + if (strtolower($filename) === 'phpinfo' && !preg_match('/\//', $filename)) { return 'phpinfo'; } - if (strtolower($filename) === 'ict') { + if (strtolower($filename) === 'ict' && !preg_match('/\//', $filename)) { return 'ICT'; } @@ -718,6 +719,9 @@ class CodePressCMS { // Get the directory name from the path, not from a potential file $pathParts = explode('/', $pagePath); $dirName = end($pathParts); + + // Get the directory name from path, not from a potential file + $title = $this->formatDisplayName($dirName) ?: 'Home'; $content = '