Changeset - 7e1be644afac
[Not reviewed]
default
0 1 0
Nathan Brink (binki) - 15 years ago 2011-01-27 20:01:01
ohnobinki@ohnopublishing.net
Rework HTTP Accept: header handling so that browsers which don't send Accept: headers get XHTML.
1 file changed with 2 insertions and 3 deletions:
0 comments (0 inline, 0 general)
inc/class.page.php
Show inline comments
 
@@ -119,9 +119,8 @@ class page
 
    $this->scripts = $nscripts;
 

	
 
   /* Compliant browsers which care, such as gecko, explicitly request xhtml: */
 
   if(!empty($_SERVER['HTTP_ACCEPT'])
 
      && (strpos($_SERVER['HTTP_ACCEPT'], 'application/xhtml+xml') !== FALSE
 
	  || !strlen($_SERVER['HTTP_ACCEPT'])) /* then the browser doesn't care :-) */)
 
   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');
0 comments (0 inline, 0 general)