Remove hash when retrieving the query string

When using URLs like `http://example.com/some/path?aa=AA&sort(+title)&bb=BB%20BB#cc=CC`, the getQueryParam() would consider the #-symbol as a value of `bb`, when it should stop before the fragment identifier instead.