This prohibition has been interpreted in different ways. Imam Abu Hanifah is of the view that it prohibits them only from the performance of Hajj and Umrah, and from the observance of the rites of ignorance in the holy precincts. But Imam Shafii is of the opinion that they have been forbidden even to enter the AlMasjid-AlHaram for any purpose whatsoever. Imam Malik is of the opinion that they are forbidden not only to enter AlMasjid-AlHaram but any mosque at all. It is, however, obvious that the last opinion is not correct, as the Prophet (peace be upon him) himself permitted mushriks to enter the Prophet’s mosque at Al-Madinah.[SOURCE]
So in this commentary, the commentater say the following "as the Prophet (peace be upon him) himself permitted mushriks to enter the Prophet’s mosque at Al-Madinah".
What is the source of this.