Ata' (may Allah have mercy on him) says: In the Days of Ignorance there were prostitutes who were open about it: the prostitute of such-and-such family, the prostitute of such-and-such family. So Allah Almighty said: "The fornicator does not marry except a fornicatress or a polytheist woman, and the fornicatress none marries her except a fornicator or a polytheist man, and that has been made unlawful for the believers." [Surah al-Nur: 3] So through Islam Allah Almighty forbade that practice of the Days of Ignorance. Ibn Jurayj (may Allah have mercy on him) says: Ata' (may Allah have mercy on him) was asked: "Did this reach you from Ibn Abbas (may Allah be pleased with them both)?" He said: "Yes."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب النكاح / 13862