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

Don't encode phrase parameters?

Discussion in 'XenForo Development Discussions' started by Liam W, May 29, 2014.

  1. Liam W

    Liam W Well-Known Member

    I have a url being passed as a named parameter to a phrase, but it has get params, but the & symbol is being encoded to a html entity.

    Can I stop this?
     
  2. Chris D

    Chris D XenForo Developer Staff Member

    In a template, pass the URL as {xen:raw} and in PHP pass false as the third parameter to new XenForo_Phrase().

    Though I have to say... this is not something I've had to worry about before.

    Are you saying you're just passing a URL string such as: "index.php?param1=1&param2=2" and it's changing & into &?

    I have tested this and I do not need to use any of the methods I mentioned to get this to work.
     
    Last edited: May 29, 2014
    Liam W likes this.
  3. Liam W

    Liam W Well-Known Member

    I'm building the link using the XenForo link class, with extra params.

    I'm then passing this built link into a phrase as a named parameter. The ampersand in the url then appears in the phrase as &.

    Liam
     
  4. Chris D

    Chris D XenForo Developer Staff Member

    Yeah, third parameter of XenForo_Phrase set to false fixes it.
     
  5. Liam W

    Liam W Well-Known Member

    Yeah, it does. Thanks :)
     

Share This Page