All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad (sallallaahu 'alayhi wa sallam) is His slave and Messenger.
We first point out that a child born out of wedlock is not attributed to the man who committed zina; rather, the child is attributed to his mother. Consequently, she is responsible for his care and financial support, and there is no legal relationship between him and his biological father.
Secondly: The one who has the authority to marry off a woman is her legitimate father and her paternal relatives. The mere fact that a man is married to the mother does not make him a guardian (wali) for his wife’s daughter.
Hence, if the woman has no guardian, then she is married by the Muslim ruler, or whoever acts on his behalf, such as the administrators of Islamic centers in non-Muslim countries. It is established from the Prophet (sallallaahu 'alayhi wa sallam) that he (sallallaahu 'alayhi wa sallam) said: “The ruler is the guardian of the one who has no guardian.” (Imam Abu Dawood, Imam Al-Tirmithi, and Imam Ibn Majah (
))
Allah knows best.