What is the ruling on praying toward a niche bearing apparent signs of Islam?

Chapter on Facing the Qiblah

Al-Mughni

Book of Prayer

Book 3 · Issue 3 · Bab 4

Open in Qurani

Primary text

If a niche shows traces of Islam, one must not pray toward it due to the possibility that its builder was a polytheist mocking Muslims and attempting to deceive them. However, if certainty is established that it is a niche belonging to Muslims, such that the possibility of deception is eliminated, then it may be faced for prayer.