[ticket/12791] Changed the if check

Removed unneeded variable

PHPBB3-12791