BUGFIX: Fixed case where image paths could end up having a backslash on windows

This commit is contained in:
UndefinedOffset 2016-03-11 10:38:52 -04:00
parent 405af6b377
commit 10ef060624
1 changed files with 4 additions and 4 deletions

View File

@ -238,16 +238,16 @@ class DocumentationParser
}
// Rewrite URL (relative or absolute)
$baselink = DocumentationHelper::relativePath(
$baselink = DocumentationHelper::relativePath(DocumentationHelper::normalizePath(
dirname($page->getPath())
);
));
// if the image starts with a slash, it's absolute
if (substr($url, 0, 1) == '/') {
$relativeUrl = str_replace(BASE_PATH, '', Controller::join_links(
$relativeUrl = DocumentationHelper::normalizePath(str_replace(BASE_PATH, '', Controller::join_links(
$page->getEntity()->getPath(),
$url
));
)));
} else {
$relativeUrl = rtrim($baselink, '/') . '/' . ltrim($url, '/');
}