Just regarding the QLD law. It is but it isn't. There is more than that out there on the web but I'm on the phone and this was the first I could find. So yes, it is illegal, unless the physical and mental wellbeing of the mother is at risk.
I'm guessing that is what the PP was referring to.
You'll have to excuse the iPhone auto correct. It sax!