Allow square brackets in a URL when it's sanitised for a redirect. Square brackets are valid in query parameters and IPv6 addresses.

Fixes #17052
Props voldemortensen


git-svn-id: https://develop.svn.wordpress.org/trunk@30683 602fd350-edb4-49c9-b593-d223f7449a82