1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Fixed Route filter - watched/threads can't be filtered to x/ as trailing slash is added

Discussion in 'Resolved Bug Reports' started by Brogan, Mar 3, 2014.

  1. Brogan

    Brogan XenForo Moderator Staff Member

    As title.

    Confirmed with Mike.
     
    MattW likes this.
  2. Mike

    Mike XenForo Developer Staff Member

    There was a check to ensure that the trailing slashes on the find and replace routes were the same. Looking back, it's been this way since before the first 1.2 beta was released -- actually very quickly after the system was written.

    However, I'm trying to figure out what sort of bad circumstance would come up if this constraint were removed and nothing significant is jumping to mind. As such, I'll remove the limit with the caveat that if something comes up that's worse than not being able to add a route filter, we may have to replace it.
     
  3. Mike

    Mike XenForo Developer Staff Member

    Ok, I stand corrected, there's a pretty easy way to break things with this: threads/{x}/ -> threads/{x}

    That will lead to a situation where a URL like threads/123action will be generated, which makes the action unusable.
     
  4. Mike

    Mike XenForo Developer Staff Member

    Right, I'm think I'm going to settle on splitting the difference: if your find route ends with a /, your replace route ends will be forced to end with a /. This allows the watched/threads -> prefix/ case while also eliminating the problem mentioned in my previous post. (If you do threads/{x} -> threads/{x}/, the everything still works -- you just get some extra slashes.)
     
    TBDragon likes this.

Share This Page