bug 32168. This implements RFC3986 Section 5.2.4. http://tools.ietf.org/html/rfc3986#section-5.2.4 This is important because you need to remove dot segments in order to safely compare URLs when limiting URLs to a particular path.