1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-09 08:17:12 +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']); $info = parse_url($_SERVER['REQUEST_URI']);
$parts = explode('/', $info['path']); $parts = explode('/', $info['path']);
$charset = $config->pageNameCharset; $charset = $config->pageNameCharset;
$i = 0; foreach($parts as $i => $part) {
foreach($parts as $part) {
if($i > 0) $url .= "/"; if($i > 0) $url .= "/";
$url .= ($charset === 'UTF8' ? $sanitizer->pageNameUTF8($part) : $sanitizer->pageName($part, false)); $url .= ($charset === 'UTF8' ? $sanitizer->pageNameUTF8($part) : $sanitizer->pageName($part, false));
$i++;
} }
if(!empty($info['path']) && substr($info['path'], -1) == '/') { if(!empty($info['path']) && substr($info['path'], -1) == '/') {
$url = rtrim($url, '/') . '/'; // trailing slash $url = rtrim($url, '/') . '/'; // trailing slash