Reference: http://binothaimeen.net/content/7008
Fataawa Noor ‘alad-Darb – Tape No.34
Question: Is it permissible for a person to mention Allaah in the toilet, and a bathroom in which he relieves himself; for example, by saying ‘subhaa-nAllaah’ and ‘astagh-firullaah’ whilst he is [actually] seated on the toilet?
Response: That which is known amongst many of the scholars is that it is disliked to mention Allaah with one’s tongue [whilst in the toilet]. As for mentioning Him in his heart, and continuing to do this in his heart – then there is no harm in that.