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 089bec6cbc2725d9016468f1e9b1fed6492ab822..cf2a95ee610edf0457a4897e26f41b8a8326adcb 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 f9083fd90bfb315ac8ea47ad43cf49f73a42e096..d18609f63fc7c3010f0437854900586fabfdc411 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 eb7a1c49268e2cd26b7a8ff160e7477f08f48837..d6947d92cb3e43305381207d52ae0faf58e95870 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 39b78efe10cdc3236039850fcd46d3ec500e17f8..4f02a061d2e0340d98087705a18cce225229f8e2 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 5143369fde10ec05c05475d3d2e4ba120368d805..bfefa5dc3836220a9fb2ba757a4d024241ec65bc 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 5409bca415c87bc84e76f373cbba1ae8bab75477..69f9ec740690ff376ad540a1b6d46f64498431f6 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";