On July 20, 2017, Moroccan authorities had imposed a protest ban. When passers-by who recognized him stopped him and started a conversation with him about the Hirak, Mahdaoui criticized the ban. He was accused and convicted of "inciting" a protest.