diff options
author | Christian Schneider | 2017-11-29 15:59:11 +0100 |
---|---|---|
committer | Christian Schneider | 2017-11-29 15:59:11 +0100 |
commit | a5fdef178ddda946429d95616266d8fec7f73a1a (patch) | |
tree | 0be9079ecad3d397f9cac1d56ffcac52c8c6596e | |
parent | 5d6993d445fe85c5ad1d3adc511ade8672708d8c (diff) | |
download | itools-a5fdef178ddda946429d95616266d8fec7f73a1a.tar.gz itools-a5fdef178ddda946429d95616266d8fec7f73a1a.tar.bz2 itools-a5fdef178ddda946429d95616266d8fec7f73a1a.zip |
Do not add / for non-http url without path
-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" } ] |