diff --git a/cms/core/class/CodePressCMS.php b/cms/core/class/CodePressCMS.php index 7ca4b7e..557be0e 100644 --- a/cms/core/class/CodePressCMS.php +++ b/cms/core/class/CodePressCMS.php @@ -579,9 +579,9 @@ class CodePressCMS { // Auto-link page titles to existing content pages (but not in H1 tags) $body = $this->autoLinkPageTitles($body, $cleanName); - // Convert relative internal links to clean URLs + // Convert relative internal links to clean URLs (skip already-prefixed URLs) $body = preg_replace('/href="\/blog\/([^"]+)"/', 'href="/' . $this->currentLanguage . '/blog/$1"', $body); - $body = preg_replace('/href="\/([^"]+)"/', 'href="/' . $this->currentLanguage . '/$1"', $body); + $body = preg_replace('/href="\/(?!nl\/|en\/|nl"|en")([^"]+)"/', 'href="/' . $this->currentLanguage . '/$1"', $body); return [ 'title' => $title ?: $cleanName ?: 'Untitled',