أَخْبَرَنَا أَبُو زَكَرِيَّا بْنُ أَبِي إِسْحَاقَ ، أَخْبَرَنَا أَبُو الْحَسَنِ بْنُ عَبْدُوسٍ ، حَدَّثَنَا عُثْمَانُ بْنُ سَعِيدٍ ، حَدَّثَنَا الْقَعْنَبِيُّ فِيمَا قَرَأَ عَلَى مَالِكٍ ، عِنْ زَيْدِ بْنِ أَسْلَمَ ، عَنْ عَطَاءِ بْنِ يَسَارٍ أَنَّهُ أَخْبَرَهُ أَنَّهُ قَالَ : كَانَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ فِي الْمَسْجِدِ ، فَدَخَلَ رَجُلٌ ثَائِرُ الرَّأْسِ وَاللِّحْيَةِ ، فَأَشَارَ إِلَيْهِ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ أَنِ اخْرُجْ ، فَأَصْلِحْ رَأْسَكَ ، وَلِحْيَتَكَ ، فَفَعَلَ ثُمَّ رَجَعَ ، فَقَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ : " أَلَيْسَ هَذَا خَيْرًا مِنْ أَنْ يُلْقَى أَحَدُكُمْ ثَائِرَ الرَّأْسِ كَأَنَّهُ شَيْطَانٌ " .
Ata bin Yasar (may Allah have mercy on him) narrates that the Messenger of Allah (peace and blessings be upon him) was (sitting) in the mosque when a man came in with dishevelled hair and beard. The Messenger of Allah (peace and blessings be upon him) gestured to him to go out and set his head and beard in order. He did so and then came back, so the Messenger of Allah (peace and blessings be upon him) said: "Is this not better than that one of you should appear with dishevelled hair as though he were a devil?"