أَخْبَرَنَا أَبُو بَكْرِ بْنُ الْحَارِثِ الْفَقِيهُ، أنبأ أَبُو مُحَمَّدِ بْنُ حَيَّانَ الْأَصْبَهَانِيُّ، أنبأ ابْنُ أَبِي عَاصِمٍ، ثنا ابْنُ كَاسِبٍ، ثنا ابْنُ أَبِي حَازِمٍ، وَسُفْيَانُ بْنُ حَمْزَةَ، عَنْ كَثِيرِ بْنِ زَيْدٍ، عَنِ الْوَلِيدِ بْنِ رَبَاحٍ، عَنْ أَبِي هُرَيْرَةَ رَضِيَ اللهُ عَنْهُ قَالَ: قَالَ رَسُولُ اللهِ صلَّى الله عَلَيْهِ وَسَلَّمَ: " الْمُسْلِمُونَ عِنْدَ شُرُوطِهِمْ فِيمَا وَافَقَ الْحَقَّ " لَفْظُ سُفْيَانَ بْنِ حَمْزَةَ وَرُوِيَ ذَلِكَ مِنْ وَجْهٍ ثَالِثٍ ضَعِيفٍ عَنْ عَائِشَةَ رَضِيَ اللهُ عَنْهَا وَعَنْ أَنَسِ بْنِ مَالِكٍ مَرْفُوعًا.
Sayyiduna Abu Hurayrah (may Allah be pleased with him) said that the Messenger of Allah (peace and blessings be upon him) said: "The Muslims are bound by their conditions, insofar as they agree with the truth."
This was also narrated through a third, weak route from Sayyidah Aishah and Anas bin Malik (may Allah be pleased with them), attributed to the Prophet (peace and blessings be upon him).