[ticket/11816] Fix multiple parenthesis as well before $VARs in templates

PHPBB3-11816
Merge remote-tracking branch 'EXreaction/ticket/11816-2' into develop

* EXreaction/ticket/11816-2:
  [ticket/11816] Fix multiple parenthesis as well before $VARs in templates