[ticket/12097] Validate_data() should work with class method

https://tracker.phpbb.com/browse/PHPBB3-12097

PHPBB3-12097
[ticket/12097] Bug fix and adding unit test

PHPBB3-12097
Merge pull request #2359 from Nicofuma/ticket/12097

[ticket/12097] Validate_data() should work with class method

* Nicofuma/ticket/12097:
  [ticket/12097] Bug fix and adding unit test
  [ticket/12097] Validate_data() should work with class method