[ticket/12413] Remove unnecessary casts

PHPBB3-12413