Sayyiduna Anas bin Malik (may Allah be pleased with him) narrates: Once the Prophet Muhammad (peace and blessings be upon him) was leading the people in prayer, and some donkeys passed in front of him. Among those praying behind the Prophet (peace be upon him), ‘Ayyash bin Abu Rabi‘ah began to say "Subhan Allah." When the Prophet (peace be upon him) finished the prayer with salam, he asked: "Who was saying Subhan Allah just now?" He replied: "O Messenger of Allah! I said it, because I have heard that if a donkey passes in front, the prayer is invalidated." The Prophet (peace be upon him) said: "Nothing (that passes in front) invalidates the prayer."
Hadith Referenceسنن الدارقطني / كتاب الصلاة / 1380
Hadith Gradingمحدثین:إسناده ضعيف
Hadith Takhrij«إسناده ضعيف ، وأخرجه البيهقي فى((سننه الكبير)) برقم: 3560، والدارقطني فى ((سننه)) برقم: 1380، وقال ابن حجر: فى إسناد كل منهما ضعف ، تحفة الأحوذي شرح سنن الترمذي: 275/1»