change file detection from strpos to substr to match only file extension...

...s and ignore e.g. ".xml.swp" or ".xml.testing" files