[ticket/11413] Prevent recursive function calls

PHPBB3-11413