[ticket/11701] Loop variables are not passed correctly to events

PHPBB3-11701
[ticket/11701] Remove useless str_replace

PHPBB3-11701
[ticket/11701] Fix loops var check

PHPBB3-11701
[ticket/11701] Fix regex for appending |length

PHPBB3-11701
[ticket/11701] Refix regex for appending |length

PHPBB3-11701
[ticket/11701] Test events in loops

PHPBB3-11701
[ticket/11701] New line at EOF

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

* EXreaction/ticket/11701:
  [ticket/11701] New line at EOF
  [ticket/11701] Test events in loops
  [ticket/11701] Refix regex for appending |length
  [ticket/11701] Fix regex for appending |length
  [ticket/11701] Fix loops var check
  [ticket/11701] Remove useless str_replace
  [ticket/11701] Loop variables are not passed correctly to events