Fix problems where filename contains no extension (date paths end up like this) and change strrpos to check falsey correctly.