[ticket/13105] Fix the code logic as described in the comment

PHPBB3-13105
Merge pull request #3005 from nickvergessen/ticket/13105

[ticket/13105] Fix the code logic as described in the comment

* nickvergessen/ticket/13105:
  [ticket/13105] Fix the code logic as described in the comment