Skip to content

Commit c4c3ef7

Browse files
authored
fix path info did not work on server
1 parent d18a5e6 commit c4c3ef7

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

app/public/index.php

+7-4
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,13 @@
3434

3535
// Set view in Container
3636
$container->set('view', function () {
37-
if (!empty($_SERVER['PATH_INFO'])) {
38-
$matomoVersionFromUrl = MatomoVersionMiddleware::getMatmoVersionFromUrl($_SERVER['PATH_INFO']);
39-
if (!empty($matomoVersionFromUrl)) {
40-
Environment::setPiwikVersion($matomoVersionFromUrl);
37+
foreach (['ORIG_PATH_INFO', 'PATH_INFO'] as $pathServer) {
38+
if (!empty($_SERVER[$pathServer])) {
39+
$matomoVersionFromUrl = MatomoVersionMiddleware::getMatmoVersionFromUrl($_SERVER[$pathServer]);
40+
if (!empty($matomoVersionFromUrl)) {
41+
Environment::setPiwikVersion($matomoVersionFromUrl);
42+
break;
43+
}
4144
}
4245
}
4346

0 commit comments

Comments
 (0)