From b6f0f72a0992596f68f5aa1d4513e6bd3884a2c0 Mon Sep 17 00:00:00 2001 From: Robin Millette Date: Mon, 2 Feb 2009 21:08:33 +0000 Subject: [PATCH] trac #569 and trac #711 add missing utf-8 headers and removed extraneous argument in startHTML calls --- lib/clienterroraction.php | 2 +- lib/servererroraction.php | 2 +- lib/util.php | 5 ++++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/clienterroraction.php b/lib/clienterroraction.php index ef6fd51dff..5019dc06de 100644 --- a/lib/clienterroraction.php +++ b/lib/clienterroraction.php @@ -70,7 +70,7 @@ class ClientErrorAction extends ErrorAction 417 => 'Expectation Failed'); $this->default = 400; } - + // XXX: Should these error actions even be invokable via URI? function handle($args) diff --git a/lib/servererroraction.php b/lib/servererroraction.php index a398865915..80a3fdd7b4 100644 --- a/lib/servererroraction.php +++ b/lib/servererroraction.php @@ -67,7 +67,7 @@ class ServerErrorAction extends ErrorAction $this->default = 500; } - + // XXX: Should these error actions even be invokable via URI? function handle($args) diff --git a/lib/util.php b/lib/util.php index 3690f0ad54..3314cdfa0a 100644 --- a/lib/util.php +++ b/lib/util.php @@ -1391,7 +1391,7 @@ function common_negotiate_type($cprefs, $sprefs) } $bestq = 0; - $besttype = "text/html"; + $besttype = 'text/html'; foreach(array_keys($combine) as $type) { if($combine[$type] > $bestq) { @@ -1400,6 +1400,9 @@ function common_negotiate_type($cprefs, $sprefs) } } + if ('text/html' === $besttype) { + return "text/html; charset=utf-8"; + } return $besttype; }