Fix getExtension with PHP < 5.3.6