Reintroduce check and workaround for '.php.' in filename (with better documentation)