There is nothing in scripture that says that Mary Magdalene was a prostitute.
She did follow Jesus along with several other women of whom we have three called by name, Mary Magdalene, Joanna the wife of Chuza and Susanna.
Jesus did cast seven demons out of her. That would have been after the start of His ministry making it highly unlikely that they were married before then, (would you marry a woman with seven devils in her?) and it is unlikely that they would have been married afterwards as those are the most heavily covered years of his life and it would have been mentioned.
Therefore, using the only records we have the conclusion must be that ABC is to put it kindly, very mistaken.
And is there any reason why Mary Magedala could not have had seven devils (spiritual explanation)/psychological problems (rational explanation) develop *after* her marriage? There is a least a decade of life of the adult Jesus for which there are no records.