URI component check. Closes #2115

Avoids AngularJS apps crashing when a malformed GET parameter is
added to the URL.