Sayyiduna Jabir (may Allah be pleased with him) narrates: Smiling does not invalidate the prayer, but laughing out loud does.
This is the preserved (mahfuz) version, as mawquf (a statement of the Companion). Thabit bin Muhammad al-Zahid narrated it as marfu' (from the Prophet), and that is an error (wahm) on his part.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 3359