ECHR vs Bill of Rights

Will Tovey has written an interesting ‘blog post criticising Theresa May’s recent announcement of a new Bill of Rights that would replace the Human Rights Act (HRA) and withdraw the UK from the oversight provided by the European Court of Human Rights (ECHR). I’d recommend reading it to anyone interested in going beyond the superficial political/tabloid hype.

In the post Will challenges various misconceptions, including

  • courts aren’t entitled to make laws
  • the HRA is all about foreign judges meddling in UK law
  • criminals have no rights

Along with various clear arguments in favour of preserving the connection with the ECHR, such as

  • protecting individuals from the state
  • judges having more experience with the intricacies of law than politicians
  • judges are less likely than politicians to be vote chasing when ruling how to apply laws

Will summarises:

Human Rights are fundamental, inalienable and indivisible rights that protect all of us, equally. Any government that wants to remove such protection is demonstrating a thirst for power that is unhealthy and dangerous in a civilised society. It is important that the human rights of any one person, even a criminal, are upheld – as soon as we say it is acceptable to take away rights from just one person, we are all put at risk.

There is also a very good and related article on the BBC News website. The article notes that having laws that were not subject to judicial review was inconceivable, that it would be a disaster for the UK to not comply with the ECHR ruling (on votes for prisoners), and how not doing so would leave the UK comparable to 1967 Greece ruled by a dictatorship.

“The only country which denounced the Convention was Greece in 1967 at the time of the dictatorship of the colonels. I cannot imagine …  that the UK, which is a great country, could be in the same situation as the colonels in 1967.”

PHP DOMNode -> setAttribute() max-width confusion

While adding some custom code into Mahara, I came across what seems like a very odd PHP bug today, so odd that I put it down to user error, but just can’t seem to find what the user error is! Imagine the code below with some embed code from youtube or picasa as the value of $embedCode.
$embedCode = "<embed .................></embed>";
$dom = new DOMDocument();
$dom->loadHTML($
embedCode);
$allElements = $dom->getElementsByTagName('*');
$firstElement = $allElements->item(2);
$
firstElement->setAttribute("style", "max-width:100%");
echo $dom->saveHTML();

The line that plays up is the one including setAttribute(“style”, “max-width:100%”).

It works on pretty much all other possible css values, but doesn’t seem to like max-width nor min-width. I can set the style to hold color or background values, or text-align, but not max-width! What gives? Why does PHP seem to have CSS max-width?

EDIT: I have since uncovered the cause of this. My text string was being passed through a Mahara function clean_html() which strips out various things, including max-width style definitions. The solution is to clean_html() before I apply my max-width and hey presto, everything works as expected.