Remove trailing dashes from URLSegment
Merge pull request #2871 from feejin/urlsegment-trailing-space

BUG Trim URLSegment before applying replacements in filter