The Court of Appeal has ruled that Transport for London was justified in refusing to run a series of advertisements for a controversial Christian charity.

The Core Issues Trust had challenged the decision to say no to ‘gay cure’ advertisements, which ’caused widespread offence to the public,’ according to TfL. The ads read: ‘Not Gay! Ex-Gay, Post-Gay and Proud. Get over it!’ in the same style as the Stonewall ‘Some people are gay. Get over it!’ advert which had run a few months earlier.

In his judgement, Lord Dyson stated that ‘the restrictions are justified [because] they would be seen by, and cause offence to, large numbers of the public in central London.’ He went on to say that the advertisement was liable to encourage homophobic views and place gay people at risk.

Dyson – the second most senior judge in England and Wales – would have been seen as countering that message, encouraging instead ‘gay rejection’ by implying offensively and controversially that homosexuality can be cured.

However, the court ruled that Mayor of London Boris Johnson must be investigated to decide whether he acted ‘for an improper purpose.’ The Core Issues Trust argued he unlawfully used his position as the Chairman of TfL to ban the advert in 2012 for political gain, since it was only a few weeks before an election.

Lord Dyson commented: ‘The need for an examination of the role of the Mayor is all the greater because the … email shows that the Mayor’s Office contacted the Guardian immediately apparently in order to make political capital out of the story and arrangements had been made for the Mayor to appear on April 13 at hustings organised by Stonewall.’

‘This is a most unsatisfactory state of affairs.’

Despite this, even if it is ruled that Johnson acted illegally, TfL would be justified in banning the advertisement for a second time, due to its offensive nature.

Outgoing Stonewall chief executive Ben Summerskill, said: ‘It does seem slightly extraordinary that a trust which claims to promote Christian values doesn’t put its energies into tackling famine or global poverty.’

‘They do give all the impression of being obsessed with sex.’