Can drugs affect your period?

Okay please don't say how taking drugs is wrong and other things along those lines.

So basically the weekend before my period was due, I smoked some weed, and took some ecstasy, then the next day I took ecstasy again. Then 4 days later my period arrived but it only lasted 3 days compared to my usual 7 days.

Does anybody know if drugs can affect the length of your period? If not, does anybody know why this has happened? And has it ever happened to anyone else?