Safe url handling

We should consider merging this.

<!---
@huboard:{"order":402.5}
-->