[ticket/11525] Use foreach instead of array_walk in method clean_row()

This approach is cleaner and probably even faster the previous ways that
included using array_walk() or array_map() and other helper functions
and methods.

PHPBB3-11525