[ticket/11948] Use basename and dirname

PHPBB3-11948