If any sheriff or other officer sells any real estate by virtue of any judgment, otherwise than in the manner provided by law, or without such previous notice, the officer so offending shall, for every such offense, forfeit and pay the sum of $50, to be recovered with costs of the action by the person whose property is sold.
However, no such offense, nor any irregularity on the part of the sheriff, or other officer having the certified copy of the judgment for enforcement, shall affect the validity of any sale made under it, unless the purchaser had notice thereof.
735 ILCS 5/12-116