r3340 HTTP response header is a better place for charset information,
authorDenis Ovsienko <infrastation@yandex.ru>
Thu, 11 Mar 2010 22:49:30 +0000 (22:49 +0000)
committerDenis Ovsienko <infrastation@yandex.ru>
Thu, 11 Mar 2010 22:49:30 +0000 (22:49 +0000)
than HTML META element (ticket #312 by Ã˜ystein Rose).

ChangeLog
inc/exceptions.php
inc/interface.php
index.php
install.php
popup.php

index 089bec6..cf2a95e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,7 @@
        update: make object form messages consistent (by Tyler J. Wagner)
        update: sort object ports in a more reasonable manner
        bugfix: completely fix ticket:211
+       bugfix: declare charset in HTTP header (#312)
 0.17.9 2010-02-17
        new feature: added per-user UI options (ticket:29)
        new feature: LDAP cache can be disabled now (ticket:247)
index f9083fd..d18609f 100644 (file)
@@ -143,10 +143,10 @@ function stringTrace($trace)
 function print404($e)
 {
        header("HTTP/1.1 404 Not Found");
+       header ('Content-Type: text/html; charset=UTF-8');
        echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'."\n";
        echo '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">'."\n";
        echo "<head><title> Exception </title>\n";
-       echo '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';
        echo "<link rel=stylesheet type='text/css' href=pi.css />\n";
 #      echo "<link rel=icon href='" . getFaviconURL() . "' type='image/x-icon' />";
        echo '</head> <body>';
@@ -158,10 +158,10 @@ function print404($e)
 function printNotAuthorizedException($e)
 {
        header("HTTP/1.1 401 Unauthorized");
+       header ('Content-Type: text/html; charset=UTF-8');
        echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'."\n";
        echo '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">'."\n";
        echo "<head><title> Unauthorized </title>\n";
-       echo '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';
        echo "<link rel=stylesheet type='text/css' href=pi.css />\n";
 #      echo "<link rel=icon href='" . getFaviconURL() . "' type='image/x-icon' />";
        echo '</head> <body>';
@@ -172,10 +172,10 @@ function printNotAuthorizedException($e)
 function printPDOException($e)
 {
        header("HTTP/1.1 500 Internal Server Error");
+       header ('Content-Type: text/html; charset=UTF-8');
        echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'."\n";
        echo '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">'."\n";
        echo "<head><title> PDO Exception </title>\n";
-       echo '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';
        echo "<link rel=stylesheet type='text/css' href=pi.css />\n";
 #      echo "<link rel=icon href='" . getFaviconURL() . "' type='image/x-icon' />";
        echo '</head> <body>';
@@ -201,10 +201,10 @@ function printPDOException($e)
 function printGenericException($e)
 {
        header("HTTP/1.1 500 Internal Server Error");
+       header ('Content-Type: text/html; charset=UTF-8');
        echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'."\n";
        echo '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">'."\n";
        echo "<head><title> Exception </title>\n";
-       echo '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';
        echo "<link rel=stylesheet type='text/css' href=pi.css />\n";
        echo "<link rel=icon href='pix/racktables.ico' type='image/x-icon' />";
        echo '</head> <body>';
index eb7a1c4..d6947d9 100644 (file)
@@ -5379,10 +5379,10 @@ function renderMyPreferences ()
 
 function renderAccessDenied ()
 {
+       header ('Content-Type: text/html; charset=UTF-8');
        echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'."\n";
        echo '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">'."\n";
        echo "<head><title>RackTables: access denied</title>\n";
-       echo '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';
        echo "<link rel=stylesheet type='text/css' href=pi.css />\n";
        echo "<link rel=icon href='" . getFaviconURL() . "' type='image/x-icon' />";
        echo "</head><body>";
index 39b78ef..4f02a06 100644 (file)
--- a/index.php
+++ b/index.php
@@ -9,13 +9,13 @@ fixContext();
 redirectIfNecessary();
 if (!permitted())
        renderAccessDenied();
+header ('Content-Type: text/html; charset=UTF-8');
 // Only store the tab name after clearance is got. Any failure is unhandleable.
 $_SESSION['RTLT'][$pageno] = $tabno;
 
 echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'."\n";
 echo '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">'."\n";
 echo '<head><title>' . getTitle ($pageno) . "</title>\n";
-echo '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';
 echo "<link rel=stylesheet type='text/css' href=pi.css />\n";
 echo "<link rel=icon href='" . getFaviconURL() . "' type='image/x-icon' />";
 printStyle();
index 5143369..bfefa5d 100644 (file)
@@ -35,11 +35,11 @@ if ($step > count ($stepfunc))
 }
 $title = "RackTables installation: step ${step} of " . count ($stepfunc);
 require_once ('inc/dictionary.php');
+header ('Content-Type: text/html; charset=UTF-8');
 ?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 <head><title><?php echo $title; ?></title>
-<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
 <link rel=stylesheet type='text/css' href=pi.css />
 </head>
 <body>
index 5409bca..69f9ec7 100644 (file)
--- a/popup.php
+++ b/popup.php
@@ -57,11 +57,11 @@ function findSparePorts ($port_id, $only_racks = array())
        return $ret;
 }
 
+header ('Content-Type: text/html; charset=UTF-8');
 ?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" style="height: 100%;">
 <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
 <?php
        echo "<title>RackTables pop-up</title>\n";
        echo "<link rel=stylesheet type='text/css' href=pi.css />\n";