Sahih al-Bukhari 90:8
Narrated Muhammad bin `Ali:
`Ali was told that Ibn `Abbas did not see any harm in the Mut'a marriage. `Ali said, "Allah's Messenger (ﷺ) forbade the Mut'a marriage on the Day of the battle of Khaibar and he forbade the eating of donkey's meat." Some people said, "If one, by a tricky way, marries temporarily, his marriage is illegal." Others said, "The marriage is valid but its condition is illegal."
Reference
Sahih al-Bukhari 90:8
In-book reference
Book 90, Hadith 8
Arabic Text
حَدَّثَنَا مُسَدَّدٌ، حَدَّثَنَا يَحْيَى، عَنْ عُبَيْدِ اللَّهِ بْنِ عُمَرَ، حَدَّثَنَا الزُّهْرِيُّ، عَنِ الْحَسَنِ، وَعَبْدِ اللَّهِ، ابْنَىْ مُحَمَّدِ بْنِ عَلِيٍّ عَنْ أَبِيهِمَا، أَنَّ عَلِيًّا ـ رضى الله عنه ـ قِيلَ لَهُ إِنَّ ابْنَ عَبَّاسٍ لاَ يَرَى بِمُتْعَةِ النِّسَاءِ بَأْسًا. فَقَالَ إِنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم نَهَى عَنْهَا يَوْمَ خَيْبَرَ، وَعَنْ لُحُومِ الْحُمُرِ الإِنْسِيَّةِ. وَقَالَ بَعْضُ النَّاسِ إِنِ احْتَالَ حَتَّى تَمَتَّعَ، فَالنِّكَاحُ فَاسِدٌ. وَقَالَ بَعْضُهُمُ النِّكَاحُ جَائِزٌ وَالشَّرْطُ بَاطِلٌ.