Ref T9551. To set things up:
- Name a project aa bb. This will have the tag aa_bb.
- Try to visit /tag/aa%20bb.
Here's what happens now:
- You get an Aphront redirect error as it tries to add the trailing /. Add phutil_escape_uri() so that works again.
- Then, you 404, even though this tag is reasonably equivalent to the real project tag and could be redirected. Add a fallback to lookup, resolve, and redirect if we can find a hit for the tag.
This also fixes stuff like /tag/AA_BB/.