Allow symlinks in repo locations (don't resolve on image src)

This commit is contained in:
Ingo Schommer 2013-05-15 15:51:08 +02:00
parent 9a84f674b8
commit 6227e1eb68
2 changed files with 3 additions and 4 deletions

View File

@ -193,7 +193,7 @@ class DocumentationParser {
if($urlParts && isset($urlParts['scheme'])) continue;
// Rewrite URL (relative or absolute)
$baselink = Director::makeRelative(dirname($page->getPath()));
$baselink = Director::makeRelative(dirname($page->getPath(false, false)));
$relativeUrl = rtrim($baselink, '/') . '/' . ltrim($url, '/');
// Resolve relative paths

View File

@ -100,15 +100,14 @@ class DocumentationPage extends ViewableData {
* will return the path of the first file in the folder
* @return string
*/
function getPath($defaultFile = false) {
function getPath($defaultFile = false, $realpath = true) {
if($this->entity) {
$path = Controller::join_links(
$this->entity->getPath($this->getVersion(), $this->lang),
$this->getRelativePath()
);
if(!is_dir($path)) $path = realpath($path);
if(!is_dir($path) && $realpath) $path = realpath($path);
else if($defaultFile) {
$file = DocumentationService::find_page($this->entity, explode('/', $this->getRelativePath()));