The Prophet ﷺ said: There is no prostitution in Islam. If anyone practised prostitution in pre-Islamic times, the child will be attributed to the master (of the slave-woman). He who claims his child without a valid marriage or ownership will neither inherit nor be inherited. (Using translation from Abū Dāʾūd 2264)
قَالَ رَسُولُ اللهِ ﷺ لَا مُسَاعَاةَ فِي الْإِسْلَامِ مَنْ سَاعَى فِي الْجَاهِلِيَّةِ فَقَدْ أَلْحَقْتُهُ بِعَصَبَتِهِ وَمَنِ ادَّعَى وَلَدَهُ مِنْ غَيْرِ رِشْدَةٍ فَلَا يَرِثُ وَلَا يُورَثُ