Changeset - e633a5f890a5
[Not reviewed]
default
0 1 0
Nathan Brink (binki) - 15 years ago 2011-03-22 19:09:30
ohnobinki@ohnopublishing.net
Don't call header() to set the content type until Page::head() is called.
1 file changed with 3 insertions and 6 deletions:
0 comments (0 inline, 0 general)
inc/class.page.php
Show inline comments
 
@@ -119,12 +119,7 @@ class page
 
   /* Compliant browsers which care, such as gecko, explicitly request xhtml: */
 
   if(empty($_SERVER['HTTP_ACCEPT'])  /* then the browser doesn't care :-) */
 
      || strpos($_SERVER['HTTP_ACCEPT'], 'application/xhtml+xml') !== FALSE)
 
     {
 
       $this->xhtml = TRUE;
 
       header('Content-Type: application/xhtml+xml; charset=utf-8');
 
     }
 
   else
 
     header('Content-Type: text/html; charset=utf-8');
 

	
 
   if (count($ga_trackers))
 
     {
 
@@ -207,10 +202,12 @@ class page
 
   */
 
  public function head()
 
  {
 

	
 
    if ($this->xhtml) {
 
       header('Content-Type: application/xhtml+xml; charset=utf-8');
 
      echo '<?xml version="1.0" encoding="utf-8"?>' . PHP_EOL;
 
    }
 
    else
 
      header('Content-Type: text/html; charset=utf-8');
 

	
 
    echo '<!DOCTYPE ' . $this->doctype . '>'. PHP_EOL .
 
	  '<html ' . $this->htmlargs . '>'. PHP_EOL .
0 comments (0 inline, 0 general)