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

PHPBB3-13105