[ticket/12589] Search directly in $directory if it's an absolute sub-path

PHPBB3-12589
[ticket/12589] Fix tests

PHPBB3-12589
[ticket/12589] Add test searching in a non absolute directory

PHPBB3-12589
Merge pull request #2494 from Nicofuma/ticket/12589

[ticket/12589] Search directly in $directory if it's an absolute sub-path

* Nicofuma/ticket/12589:
  [ticket/12589] Add test searching in a non absolute directory
  [ticket/12589] Fix tests
  [ticket/12589] Search directly in $directory if it's an absolute sub-path