]> git.p6c8.net - jirafeau_project.git/commitdiff
lib/template/header.php: fix Undefined index: HTTP_ACCEPT
authorJerome Jutteau <mojo@couak.net>
Sun, 11 Oct 2015 21:10:49 +0000 (23:10 +0200)
committerJerome Jutteau <mojo@couak.net>
Sun, 11 Oct 2015 21:10:49 +0000 (23:10 +0200)
Signed-off-by: Jerome Jutteau <mojo@couak.net>
lib/template/header.php

index 275e3f0ea5e5e4bf2b1f0637fb5fae865e5cd0ca..3c2af8361df84aa4c32d9c7a10ada3499fe0078b 100644 (file)
@@ -3,7 +3,8 @@ header('Vary: Accept');
 
 $content_type = 'text/html; charset=utf-8';
 
 
 $content_type = 'text/html; charset=utf-8';
 
-if (stristr ($_SERVER['HTTP_ACCEPT'], 'application/xhtml+xml'))
+if (isset ($_SERVER['HTTP_ACCEPT']) &&
+    stristr ($_SERVER['HTTP_ACCEPT'], 'application/xhtml+xml'))
     $content_type = 'application/xhtml+xml; charset=utf-8';
 
 header('Content-Type: ' . $content_type);
     $content_type = 'application/xhtml+xml; charset=utf-8';
 
 header('Content-Type: ' . $content_type);
@@ -25,7 +26,8 @@ if (!isset ($cfg['style']))
 else
     $style = $cfg['style'];
 
 else
     $style = $cfg['style'];
 
-if (stristr ($_SERVER['HTTP_ACCEPT'], 'application/xhtml+xml'))
+if (isset ($_SERVER['HTTP_ACCEPT']) &&
+    stristr ($_SERVER['HTTP_ACCEPT'], 'application/xhtml+xml'))
 {
 ?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 {
 ?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

patrick-canterino.de