Skip to content
This repository was archived by the owner on Nov 25, 2020. It is now read-only.

Commit d4761fe

Browse files
committed
Detect if Download URL contains a full URL or just an URI. In latter case, concatenate current server host (without URI) and URI.
1 parent 809451f commit d4761fe

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

core/src/plugins/action.share/class.ShareCenter.php

+8-2
Original file line numberDiff line numberDiff line change
@@ -942,8 +942,14 @@ public function buildPublicDlURL()
942942
{
943943
$downloadFolder = ConfService::getCoreConf("PUBLIC_DOWNLOAD_FOLDER");
944944
$dlURL = ConfService::getCoreConf("PUBLIC_DOWNLOAD_URL");
945-
if ($dlURL != "") {
946-
return rtrim($dlURL, "/");
945+
if (!empty($dlURL)) {
946+
$parts = parse_url($dlURL);
947+
if($parts['scheme']) {
948+
return rtrim($dlURL, "/");
949+
} else {
950+
$host = AJXP_Utils::detectServerURL();
951+
return rtrim($host, "/")."/".trim($dlURL, "/");
952+
}
947953
} else {
948954
$fullUrl = AJXP_Utils::detectServerURL(true);
949955
return str_replace("\\", "/", rtrim($fullUrl, "/").rtrim(str_replace(AJXP_INSTALL_PATH, "", $downloadFolder), "/"));

0 commit comments

Comments
 (0)