1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-08 07:47:00 +02:00

Adjustment to PR #46

This commit is contained in:
Ryan Cramer
2017-01-03 05:16:32 -05:00
parent 5238b00250
commit 34ee4e051c

View File

@@ -492,11 +492,9 @@ class WireInput extends Wire {
$info = parse_url($_SERVER['REQUEST_URI']);
$parts = explode('/', $info['path']);
$charset = $config->pageNameCharset;
$i = 0;
foreach($parts as $part) {
foreach($parts as $i => $part) {
if($i > 0) $url .= "/";
$url .= ($charset === 'UTF8' ? $sanitizer->pageNameUTF8($part) : $sanitizer->pageName($part, false));
$i++;
}
if(!empty($info['path']) && substr($info['path'], -1) == '/') {
$url = rtrim($url, '/') . '/'; // trailing slash