mirror of
https://github.com/silverstripe/silverstripe-docsviewer
synced 2024-10-22 11:05:56 +02: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]];
|
$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())) {
|
if(!file_exists($this->getPath())) {
|
||||||
throw new InvalidArgumentException(sprintf(
|
throw new InvalidArgumentException(sprintf(
|
||||||
'Path could not be found: "%s" (module path: %s, file path: %s)',
|
'Path could not be found. Module path: %s, file path: %s',
|
||||||
$this->getPath(),
|
|
||||||
$this->entity->getPath(),
|
$this->entity->getPath(),
|
||||||
$this->relativePath
|
$this->relativePath
|
||||||
));
|
));
|
||||||
@ -61,7 +60,8 @@ class DocumentationPage extends ViewableData {
|
|||||||
* @return String
|
* @return String
|
||||||
*/
|
*/
|
||||||
function getPath() {
|
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() {
|
function getLang() {
|
||||||
|
Loading…
Reference in New Issue
Block a user