Visiting Dubai can be a perilous business, as Jamie Harron, a Briton arrested for public indecency three months ago, has discovered. According to him, it was a pure misunderstanding: he put his hand on someone to avoid spilling his drink whilst he squeezed through a crowded bar. But the furious complaint of the other man was enough for Harron to join the long list of travellers who have fallen foul of the laws and customs of a city that – for all its glitzy cosmopolitanism – is a fairly conservative, Muslim state.

Although out of jail, Harron has not been allowed to leave Dubai and has run up hefty legal bills. His appalled parents have urged other tourists to avoid the city. That seems unnecessary, given that almost 10 million travellers visited the emirate last year without any problems. But it is wise to keep a few things in mind before you book your ticket.

Mr Harron was in Dubai for a two-day stopover when he was arrested for public indecency

Pack carefully

Importing porn, pork and drugs can get you into serious trouble. In 2007, a Japanese engineer suffered the indignity of being arrested at Dubai airport after customs officials found 77 pornographic DVDs in his luggage. The same year, DJ Raymond Bingham – aka Grooverider – was sentenced to four years in prison for having a few forgotten grams of cannabis in a pair of trousers. He served a portion of his jail term before receiving a special pardon.

Even prescription drugs and painkillers can land travellers in trouble. In 2014, a 16-year-old Indian boy was arrested for carrying half a kilo of poppy seeds which his mother intended to cook with.

Swimwear is only allowed on beaches, and going topless is forbidden (Getty)

Dress appropriately

Women are expected to dress modestly in public, with arms and legs fully covered. Shopping malls will often broadcast announcements reminding people of the dress code, which is heavily enforced. Swimwear is acceptable only on beaches and at hotel pools, and topless sunbathing is forbidden – 79 people were arrested for it during a 2008 crackdown on the country’s beaches.

Men should also watch their wardrobe: in 2008 police arrested 40 “cross-dressing tourists”, according to the Gulf News.

Don't eat in public

It is forbidden to eat or drink in public during the daylight hours of the holy fasting month of Ramadan, regardless of whether or not you are Muslim. At least one foreign couple has been fined for slurping juice at a petrol station. However, the rules are usually bent at hotels; during Ramadan, they will often screen off their restaurants so foreign guests can eat without upsetting anyone.

Get married

By law, only married couples are allowed to have sex, or even share a bed, in Dubai. In practice, hotels do not ask for proof of your relationship when you check in with your partner. However, the authorities do take the matter seriously. Appallingly, in 2016 a British woman was arrested for having extramarital sex after reporting to police that she had been raped by a group of men.

Women are expected to have arms and legs covered when visiting a mall (Getty)

Beware who you tell if you're gay

Dubai’s authorities are not in the business of searching for gay tourists to arrest, even though homosexual sex is illegal. Campaign group Detained in Dubai says there is a “vibrant underground gay scene in Dubai”, but it advises discretion. “Although one should never have to hide who they are, it’s the only way to travel safely in the UAE if you are gay,” it says.

Avoid PDA