Url\Params: check for QUERY_STRING before using it

fixes #6957