Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorsgiehl <stefan@matomo.org>2022-06-21 10:41:56 +0300
committersgiehl <stefan@matomo.org>2022-06-21 10:41:56 +0300
commit6a6dce9c9c36e35a6822b7c4e05def5b84f00d07 (patch)
tree754da59e4a2ed7d5feb9260195f1466fbbc93811 /core
parent3fbdf872e3d52e6d781bd6891f73ae43a988f8cc (diff)
parenta6b8786a35b83e1967dd0bb92ff6f1e1acb47907 (diff)
Merge branch 'next_release' into 4.x-dev
Diffstat (limited to 'core')
-rw-r--r--core/AssetManager/UIAssetFetcher/PluginUmdAssetFetcher.php17
1 files changed, 16 insertions, 1 deletions
diff --git a/core/AssetManager/UIAssetFetcher/PluginUmdAssetFetcher.php b/core/AssetManager/UIAssetFetcher/PluginUmdAssetFetcher.php
index 9ac1edaec7..bfd73ca039 100644
--- a/core/AssetManager/UIAssetFetcher/PluginUmdAssetFetcher.php
+++ b/core/AssetManager/UIAssetFetcher/PluginUmdAssetFetcher.php
@@ -276,7 +276,22 @@ class PluginUmdAssetFetcher extends UIAssetFetcher
private static function getRelativePluginDirectory($plugin)
{
$result = self::getPluginDirectory($plugin);
- $result = str_replace(PIWIK_INCLUDE_PATH . '/', '', $result);
+
+ $matomoPath = rtrim(PIWIK_INCLUDE_PATH, '/') . '/';
+ $webroots = array_merge(
+ Manager::getAlternativeWebRootDirectories(),
+ [$matomoPath => '/']
+ );
+
+ foreach ($webroots as $webrootAbsolute => $webrootRelative) {
+ if (strpos($result, $webrootAbsolute) === 0) {
+ $result = str_replace($webrootAbsolute, $webrootRelative, $result);
+ break;
+ }
+ }
+
+ $result = ltrim($result, '/');
+
return $result;
}