Permalink
Browse files

Compute default path_to_root based on PUBLIC_BASEURI, that must be se…

…t anyway.
  • Loading branch information...
1 parent f76b734 commit b9a48a595a04cc983408041d075292a7da2d9e50 @cdujeu cdujeu committed Sep 9, 2016
Showing with 5 additions and 1 deletion.
  1. +5 −1 core/src/plugins/action.share/src/View/MinisiteRenderer.php
@@ -237,7 +237,11 @@ public static function writeHtml(ResponseInterface $responseInterface, ContextIn
if (!empty($data["AJXP_APPLICATION_BASE"])) {
$tPath = $data["AJXP_APPLICATION_BASE"];
} else {
- $tPath = (!empty($data["TRAVEL_PATH_TO_ROOT"]) ? $data["TRAVEL_PATH_TO_ROOT"] : "../..");
+ // Replace base uri by .. : /path/to/uri should give ../../..
+ $defaultTPath = implode("/", array_map(function ($v) {
+ return "..";
+ }, explode("/", trim(ConfService::getGlobalConf("PUBLIC_BASEURI"), "/"))));
+ $tPath = (!empty($data["TRAVEL_PATH_TO_ROOT"]) ? $data["TRAVEL_PATH_TO_ROOT"] : $defaultTPath);
}
$serverBaseUrl = ApplicationState::detectServerURL(true);

0 comments on commit b9a48a5

Please sign in to comment.