Responding to this issue Dr. Hatem Al-Haj, Professor of Fiqh he said that ‘ a woman who commited zina during her waiting period should repent to Allah a sincere repentance, because she committed adultery, which is a horrendous enormity.
In this case, her waiting period from the first man (the husband), will not end until she gives birth. Afterwards, if she and the fornicator repented, they may marry one another.
If the husband is certain the child is not his, he should decline its paternity. If he didn’t, then it is his since it was conceived while she was still a wife. (A woman in the period takes the rulings of the wife in most regards).