r673 - webspace/include

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Fri Mar 24 23:52:16 EST 2006


Author: floam
Date: 2006-03-24 23:52:15 -0500 (Fri, 24 Mar 2006)
New Revision: 673

Modified:
   webspace/include/get.php
   webspace/include/thebrain.php
Log:
Try to fix for when no UA is set.


Modified: webspace/include/get.php
===================================================================
--- webspace/include/get.php	2006-03-25 04:34:25 UTC (rev 672)
+++ webspace/include/get.php	2006-03-25 04:52:15 UTC (rev 673)
@@ -11,7 +11,6 @@
 </ul>
 <?php
 include("downloads.php");
-
 foreach ($downloads as $os => $desc) {
 	$installers .= "<li class=\"$os\">$desc</li>\n";
 }

Modified: webspace/include/thebrain.php
===================================================================
--- webspace/include/thebrain.php	2006-03-25 04:34:25 UTC (rev 672)
+++ webspace/include/thebrain.php	2006-03-25 04:52:15 UTC (rev 673)
@@ -1,5 +1,6 @@
 <?php
-$ua = get_browser(null, true);
+if ($ua = get_browser(null, true)){}
+else { $ua = $false; }
 
 $normal = '<?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
@@ -11,7 +12,7 @@
 elseif ((strpos($_SERVER['HTTP_ACCEPT'], "application/xml")) || ($ua['browser'] == "IE" && $ua['version'] >= 6)) {
 	if ($ua['browser'] == "IE") {
 		echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<?xml-stylesheet type="text/xsl" href="include/copy.xsl"?>';
+<?xml-stylesheet type="text/xsl" href="include/copy.xsl"?>\n';
 	}
 	$content_type = "application/xml";
 }
@@ -41,29 +42,32 @@
 	}
 }
 
-function determineOs() {
-	$ua = get_browser(null, true);
-	switch ($ua['platform']) {
-		case "Win95":
-		case "Win98":
-		case "WinME":
-		case "WinNT":
-		case "Win2000":		
-		case "WinXP":
-			$os = "windows";
-			break;
-		case "Linux":
-		case "FreeBSD":
-			$os = "linux";
-			break;
-		case "MacOSX":
-			$os = "apple";
-			break;
-		default:
-			$os = false;
-			break;
+function determineos() {
+	global $ua;
+	if ($ua == true) {
+		switch ($ua['platform']) {
+			case "Win95":
+			case "Win98":
+			case "WinME":
+			case "WinNT":
+			case "Win2000":		
+			case "WinXP":
+				$os = "windows";
+				break;
+			case "Linux":
+			case "FreeBSD":
+				$os = "linux";
+				break;
+			case "MacOSX":
+				$os = "apple";
+				break;
+			default:
+				$os = false;
+				break;
+		}
+	return $os;
 	}
-	return $os;
+	else { return false; }
 }
 
 if (!$_GET['page']) {




More information about the quake3-commits mailing list