getkirby-v2 / toolkit

This is the deprecated toolkit for Kirby v2.
http://getkirby.com
81 stars 50 forks source link

Url::build() builds broken URLs when a hash is present #88

Closed JonasDoebertin closed 9 years ago

JonasDoebertin commented 9 years ago

I think I just found a small bug in the Url::build() method. Take the following code:

Url::build(array(
        'query' => array(
            'foo' => 'bar',
        ),
        'hash' => 'target',
    ), 'http://example.com');

Expected output:

http://example.com/?foo=bar#target

Actual output:

http://example.com/?foo=bar/#target

See the extra / that has been added between the query and the hash? This leads to the query value beeing bar/ instead of only bar.