diff options
-rw-r--r-- | it_html.class | 2 | ||||
-rw-r--r-- | tests/U_tests.json | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/it_html.class b/it_html.class index c75f05e..35a5b11 100644 --- a/it_html.class +++ b/it_html.class @@ -569,7 +569,7 @@ static function U(/* ... */) $u[$key] ); - if (!$u['path'] && $hostpart) + if (!$u['path'] && $hostpart && preg_match('/^(https?)?$/', $u['scheme'])) $u['path'] = '/'; $queryparams = it_url::params($u['params'] + $params); diff --git a/tests/U_tests.json b/tests/U_tests.json index d340492..81ceb15 100644 --- a/tests/U_tests.json +++ b/tests/U_tests.json @@ -177,5 +177,11 @@ "args": ["http://gna.ch"], "exp": "http://gna.ch/", "name": "U() add / for absolute http url without path" + }, + + { + "args": ["app://settings"], + "exp": "app://settings", + "name": "U() do not add / for non-http url without path" } ] |