sanitize url string

fix for issue 346.