修复 url 生成时路由规则中的参数没有进行 urlencode

This commit is contained in:
ThinkCMF
2017-05-12 09:33:41 +08:00
committed by ThinkPHP
parent e45d791423
commit 4d594b9336

View File

@@ -297,7 +297,7 @@ class Url
}
foreach ($pattern as $key => $val) {
if (isset($vars[$key])) {
$url = str_replace(['[:' . $key . ']', '<' . $key . '?>', ':' . $key . '', '<' . $key . '>'], $vars[$key], $url);
$url = str_replace(['[:' . $key . ']', '<' . $key . '?>', ':' . $key . '', '<' . $key . '>'], urlencode($vars[$key]), $url);
unset($vars[$key]);
$result = [$url, $domain, $suffix];
} elseif (2 == $val) {