[ticket/13268] Properly append ternary result in get_existing_indexes()

https://tracker.phpbb.com/browse/PHPBB3-13268
Ternary operation is overwriting string instead of appending.