mirror of
https://github.com/silverstripe/silverstripe-docsviewer
synced 2024-10-22 11:05:56 +02:00
BUGFIX: Fixed case where image paths could end up having a backslash on windows
This commit is contained in:
parent
405af6b377
commit
10ef060624
@ -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, '/');
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user