The World Federation One Stop Fiqh

Ruling 1251

If during or after prayers one learns that his wuḍūʾ or ghusl was invalid, or that he started performing prayers without wuḍūʾ or ghusl, he must perform the prayer again with wuḍūʾ or ghusl; and if the time for the prayer has expired, he must make it up.