Mantis 16865 - change to be compatible with php versions earlier than 5.3

My previous change uses a feature availabile only in php 5.3 and later - the flag RecursiveDirectoryIterator::SKIP_DOTS to skip dot files. This change replaces that will an explicit test for '.' and '..' to work with earlier versions of php. 
The change works on php 5.4 but I don't have a php 5.2 site on which to test it.