modified URI function to accept urls with mising trailing slash

Hi Guys,
I've modified the URI function so the URLs with missing trailing slash will be return host in extractHostFromURL() function:
The script is also checking whether in case of missing trailing slash is there Query sign or Fragment sign in the URL so current URLs will also works:
* http://example.com#something
* http://example.com?something
Hope I understood the problem correctly.