If you become uncertain during your prayer while sitting and do not know whether you have prayed three or four units, then if your stronger impression is that you have prayed three, stand up and perform one more unit, then say the closing salutation, then perform two prostrations, then recite the testimony, then say the closing salutation again. But if your stronger impression is that you have prayed four, say the closing salutation, then perform two prostrations, then recite the testimony, then say the closing salutation again.
حدثنا محمد بن فضيل حدثنا خصيف حدثنا أبو عبيدة بن عبد الله
إذا شككت في صلاتك وأنت جالس فلم تدر ثلاثا صليت أم أربعا فإن كان أكبر ظنك أنك صليت ثلاثا فقم فاركع ركعة ثم سلم ثم اسجد سجدتين ثم تشهد ثم سلم وإن كان أكبر ظنك أنك صليت أربعا فسلم ثم اسجد سجدتين ثم تشهد ثم سلم
No references are available.
Its chain of transmission is daif because it is disconnected, and it repeats what came before it, but this one is stopped [at a companion], while that one is raised [to the Prophet].