From 03997a46ea2bacf68b610b8053829ba1b9110307 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=BCdiger=20Hahn?= Date: Sat, 31 Aug 2013 22:10:30 +0000 Subject: [PATCH] Differentiate between phones which are able to hande utf-8 and those which are not. --- app/provision/index.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/app/provision/index.php b/app/provision/index.php index d74b5a5f8a..559b48f288 100644 --- a/app/provision/index.php +++ b/app/provision/index.php @@ -444,14 +444,19 @@ require_once "resources/require.php"; //need to make sure content-type is correct $cfg_ext = ".cfg"; if ($device_vendor === "aastra" && strrpos($file, $cfg_ext, 0) === strlen($file) - strlen($cfg_ext)) { - header ("content-type: text/plain"); + header("Content-Type: text/plain"); + header("Content-Length: ".strlen($file_contents)); } else if ($device_vendor === "yealink") { - header ("content-length: ".strval(strlen($file_contents))); - header ("content-type: text/plain"); + header("Content-Type: text/plain"); + header("Content-Length: ".strval(strlen($file_contents))); + } else if ($device_vendor === "snom" && $device_template === "snom/m3") { + $file_contents = utf8_decode($file_contents); + header("Content-Type: text/plain; charset=iso-8859-1"); + header("Content-Length: ".strlen($file_contents)); } else { - header ("content-type: text/xml"); + header("Content-Type: text/xml; charset=utf-8"); + header("Content-Length: ".strlen($file_contents)); } - header ("Content-Length: ".strlen($file_contents)); echo $file_contents; //define the function which checks to see if the mac address exists in devices