Sahih Muslim , Book 7, Hadith 3097 (USC-MSA)

This hadith has been narrated on the same authority by Ubaidullah. And in the narration of Abu Bakr (the words are): " More than three (days)." Ibn Numair narrated on the authority of his father, (and the words are):" Three (days) except (when) she has a Mahram with her."

وَحَدَّثَنَا أَبُو بَكْرِ بْنُ أَبِي شَيْبَةَ، حَدَّثَنَا عَبْدُ اللَّهِ بْنُ نُمَيْرٍ، وَأَبُو أُسَامَةَ ح وَحَدَّثَنَا ابْنُ نُمَيْرٍ، حَدَّثَنَا أَبِي جَمِيعًا، عَنْ عُبَيْدِ اللَّهِ، بِهَذَا الإِسْنَادِ ‏.‏ فِي رِوَايَةِ أَبِي بَكْرٍ فَوْقَ ثَلاَثٍ ‏.‏ وَقَالَ ابْنُ نُمَيْرٍ فِي رِوَايَتِهِ عَنْ أَبِيهِ، ‏ "‏ ثَلاَثَةً إِلاَّ وَمَعَهَا ذُو مَحْرَمٍ ‏" ‏ ‏.‏

sunnah.com