Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:12:35

Then it appeared to them after they had seen the signs that al-'Azeez should surely imprison him for a time.  

Then it seemed, it appeared, ˹good˺ to them, after they had seen the signs, indicating Joseph’s innocence, that they should imprison him for a while, until such time as people ceased to talk of him. He was thus imprisoned.
القرآن:١٢:٣٥

ثُمَّ بَدَا لَهُمْ مِنْ بَعْدِ مَا رَأَوُا الْآيَاتِ لَيَسْجُنُنَّهُ حَتَّىٰ حِينٍ  

{ثم بدا} ظهر {لهم من بعد ما رأوا الآيات} الدالات على براءة يوسف أن يسجنوه دل على هذا {ليسجننه حتى} إلى {حين} ينقطع فيه كلام الناس فسجن.