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

Not a Bug $null in XenForo_LikeHandler_Post

Discussion in 'Resolved Bug Reports' started by Marcus, Sep 25, 2013.

  1. Marcus

    Marcus Well-Known Member

    In line 40: $post, $post, $post, $null, $post['permissions'], $viewingUser

    $null should be null I guess.
     
  2. Chris D

    Chris D XenForo Developer Staff Member

    You may be correct that it isn't intentional and it was meant to be NULL but it isn't technically incorrect.

    That variable in canViewPostAndContainer is &$errorPhraseKey = '' and therefore passed by reference so it actually sets $null === '' or whatever error is thrown by the subsequent functions.

    But, still, seems unintentional, so good spot :)
     
  3. Marcus

    Marcus Well-Known Member

    Just took a look and there are plenty of functions working with $null. It's rather late here tomorrow I try to understand it :)
     
  4. sonnb

    sonnb Well-Known Member

    $errorPhraseKey will be written to $null so it is not a problem here. He does not initial this variable because he does not need to use it.
     
  5. Mike

    Mike XenForo Developer Staff Member

    Since it's passed by reference, you have to pass a variable through.
     
    Marcus and Chris D like this.

Share This Page