Al-Rabi' said: I said to Imam al-Shafi'i (may Allah have mercy on him): Does anyone other than us disagree with you on this issue? He said: Yes, some of the people of the East. I asked: What was their argument? He said: Their argument was that they said: Sayyiduna Umar (may Allah be pleased with him) disowned the child of a slave woman of his, Sayyiduna Zayd bin Thabit (may Allah be pleased with him) disowned the child of a slave woman of his, and Ibn Abbas (may Allah be pleased with them both) disowned the child of a slave woman. I said: What was your argument against them, that is, your reply? He said: As for Umar (may Allah be pleased with him), it is narrated from him that he denied the pregnancy of a slave woman of his who had confessed to an abhorrent act (fornication). As for Zayd bin Thabit and Ibn Abbas (may Allah be pleased with them both), if they did so, they denied the children of two slave women whom they knew were not from them, and that is lawful for them. Likewise, the husband of a free woman, when he knows that she conceived from fornication, may repel her child and not attach to his lineage one who is not from him, as a matter between him and Allah, the Mighty and Majestic. And he discussed it at a length too long to mention here.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب اللعان / 15376