Sahih Bukhari Volume 9, Book 86, Hadith Number 91.

Narrated By Muhammad bin ‘Ali : ‘Ali was told that Ibn ‘Abbas did not see any harm in the Mut’a marriage. ‘Ali said, “Allah’s Apostle 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.”