|
12345678910111213 |
- <?php
- // Nextcloud deduplicates subsequent slashes in the path, so our $url route parameter will have been
- // corrupted to http:/something. As a workaround, we manually read the URL from the unmodified path.
- function getUrlParameter($routeName) {
- $path = $_SERVER['REQUEST_URI'];
- $routePath = "apps/memento/$routeName/"; // (presumably nobody has this string in their web root)
- $index = strpos($path, $routePath);
- if ($index === false) {
- throw new Exception("Cannot get URL parameter from unexpected path '$path'.");
- }
- $url = substr($path, $index + strlen($routePath));
- return $url;
- }
|