Fix: Trim URLSegment before applying replacements in filter

Fixing whitespace