Nikaah after an illicit relationship
Q: Musa and zainab are involved in illicit relationship for couple years, by the occurrence of the days and nights their relation became more solid because now zainab fell pregnant. To get rid from this shame the two families decided to get them married. What will be the hukam of this nikkah according to shaafi and hanafi mazhab and what will be the solution to this matter (for these people to be saved from this shame Islamically)?