- Mostly bugfixes made while working on ParcInfo
This commit is contained in:
1 parent
67040db155
commit
45c8173029
4 files changed
+28
-8
No files matched your search
@@ -165,7 +165,7 @@ class UrlExtension implements Extension {
|
||||
$_SERVER['X-Forwarded-Ssl'] ?? "",
|
||||
$_SERVER['X-Forwarded-Proto'] ?? "",
|
||||
$_SERVER['X-Forwarded-Protocol'] ?? "",
|
||||
]));
|
||||
])) || isset($_SERVER['HTTP_X_ARR_SSL']);
|
||||
|
||||
return $header
|
||||
|| ( "443" === ( $_SERVER['SERVER_PORT'] ?? "" ) )
|
||||
@@ -183,7 +183,7 @@ class UrlExtension implements Extension {
|
||||
list($variable, $default) = explode('=', $item[1]);
|
||||
}
|
||||
elseif (strpos($item[1], ":") !== false) {
|
||||
list($variable, ) = explode(':', $item[1]);
|
||||
list($variable, $type) = explode(':', $item[1]);
|
||||
}
|
||||
else {
|
||||
$variable = $item[1];
|
||||
@@ -191,6 +191,7 @@ class UrlExtension implements Extension {
|
||||
|
||||
if ( array_key_exists($variable, $arguments) ) {
|
||||
$value = $arguments[ $variable ];
|
||||
|
||||
unset($arguments[ $variable ]);
|
||||
}
|
||||
else {
|
||||
@@ -198,13 +199,22 @@ class UrlExtension implements Extension {
|
||||
}
|
||||
|
||||
$search[ $item[0] ] = $value;
|
||||
|
||||
}
|
||||
|
||||
$route = str_replace(array_keys($search), array_values($search), $route);
|
||||
}
|
||||
|
||||
return $route;
|
||||
/*
|
||||
* @TODO - must also take into account that recursivity is possible here [/test[/another[/still]]],
|
||||
* so the regex must be adjusted (or simply using another method could also be a possiblity)
|
||||
* while(strpos($route, '[') !== false && strpos($route, ']') !== false ) {
|
||||
if ( preg_match_all('~[(.*?)]~si', $route, $matches, PREG_SET_ORDER) ) {
|
||||
|
||||
}
|
||||
}*/
|
||||
$route = trim(str_replace([ '[', ']' ], '', $route), '/');
|
||||
|
||||
return $route;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user