Image copyright Getty Images

Indonesia's president has delayed a vote on controversial new laws that would have outlawed sex outside marriage.

They'd gained a lot of attention online, with the Australian government updating its advice for tourists heading to Bali.

Now President Joko Widodo says the new laws need more consideration and has delayed next week's vote.

Bali's a hugely popular destination, attracting millions of visitors each year.

There was criticism over the planned changes, with more than 500,000 people signing a petition urging the president to intervene.

The House of Representatives commission - which oversees legal matters in Indonesia - agreed on a final draft this week.

What are the proposed laws?

Under the draft laws, there would be a ban on sex outside of marriage - which could result in a one-year prison term. Criminal charges would only go ahead after a complaint by a spouse, child or parent.

Living together outside marriage could also lead to a six-month prison sentence.

Insulting the president, vice president, religion, state institutions and symbols such as the flag and national anthem would also become criminal offences.

And there would also be a maximum four-year prison term for women who have an abortion - if there were no circumstances of a medical emergency or rape.

If the code were to be passed, the law would take about two years to take effect so the public and police could become familiar with the changes.

Image copyright Getty Images Image caption President Joko Widodo has been urged to stop the new set of laws passing

But there's been criticism over the government's plan.

Human Rights Watch (HRW) has said the new laws would "violate the rights of women, religious minorities, and lesbian, gay, bisexual, and transgender people, as well as freedom of speech and association".

They also say new rules around abortion "will set back women and girls' rights under international law to make their own choices".

A warning to tourists

Politicians in Indonesia say the new set of laws would demonstrate Indonesian independence and religiosity - because they replace colonial-era Dutch laws.

"The state must protect citizens from behaviour that is contrary to the supreme precepts of God," Nasir Djamil - a politician from the Prosperous Justice Party told Reuters.

He said leaders of all religions had been consulted on the changes because Indonesia's founding ideology was based on belief in God.

Image copyright Getty Images Image caption Visitors from all over the world travel to Bali

The Australian Government updated its travel advice for tourists heading to Indonesia, warning that they could soon be charged for offences.

"A large number of laws may change and these will also apply to foreign residents and visitors, including tourists," the Department of Foreign Affairs posted to its Smart Traveller website today, before the president announced this delay.

Follow Newsbeat on Instagram, Facebook, Twitter and YouTube.

Listen to Newsbeat live at 12:45 and 17:45 weekdays - or listen back here.