mirror of
https://github.com/silverstripe/silverstripe-docsviewer
synced 2024-10-22 09:05:56 +00:00
MINOR Fixed path concat issues
This commit is contained in:
parent
a013923106
commit
f623dcc887
@ -221,6 +221,10 @@ class DocumentationEntity extends ViewableData {
|
||||
$path = $this->versions[$versions[0]];
|
||||
}
|
||||
|
||||
return $path . '/' . $lang .'/';
|
||||
return rtrim($path, '/') . '/' . rtrim($lang, '/') .'/';
|
||||
}
|
||||
|
||||
function __toString() {
|
||||
return sprintf('DocumentationEntity: %s)', $this->getPath());
|
||||
}
|
||||
}
|
@ -30,8 +30,7 @@ class DocumentationPage extends ViewableData {
|
||||
|
||||
if(!file_exists($this->getPath())) {
|
||||
throw new InvalidArgumentException(sprintf(
|
||||
'Path could not be found: "%s" (module path: %s, file path: %s)',
|
||||
$this->getPath(),
|
||||
'Path could not be found. Module path: %s, file path: %s',
|
||||
$this->entity->getPath(),
|
||||
$this->relativePath
|
||||
));
|
||||
@ -61,7 +60,8 @@ class DocumentationPage extends ViewableData {
|
||||
* @return String
|
||||
*/
|
||||
function getPath() {
|
||||
return realpath($this->entity->getPath($this->version, $this->lang) . '/' . $this->getRelativePath());
|
||||
$path = rtrim($this->entity->getPath($this->version, $this->lang), '/') . '/' . $this->getRelativePath();
|
||||
return realpath($path);
|
||||
}
|
||||
|
||||
function getLang() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user