A few fixes to Windows detection code
authorDan
Fri, 20 Mar 2009 09:13:37 -0400
changeset 871 4e45f191dc33
parent 870 82bbfe3dc8a0
child 872 8b42e51bb6e6
A few fixes to Windows detection code
install/includes/stages/website.php
plugins/SpecialPageFuncs.php
--- a/install/includes/stages/website.php	Fri Mar 20 09:13:17 2009 -0400
+++ b/install/includes/stages/website.php	Fri Mar 20 09:13:37 2009 -0400
@@ -148,7 +148,7 @@
   ?>
   
   <?php
-  $patch_necessary = ( ( strtolower(PHP_OS) == 'win32' || strtolower(PHP_OS) == 'winnt' ) && substr(@$_SERVER['SERVER_SOFTWARE'], 'Apache/2.2') );
+  $patch_necessary = ( ( strtolower(PHP_OS) == 'win32' || strtolower(PHP_OS) == 'winnt' ) && strstr(@$_SERVER['SERVER_SOFTWARE'], 'Apache/2.2') );
   if ( defined('WINDOWS_MOD_REWRITE_WORKAROUNDS') )
   {
     ?>
--- a/plugins/SpecialPageFuncs.php	Fri Mar 20 09:13:17 2009 -0400
+++ b/plugins/SpecialPageFuncs.php	Fri Mar 20 09:13:37 2009 -0400
@@ -424,9 +424,9 @@
     $platform = 'Linux';
   else if(file_exists('/hurd/pfinet')) // I have a little experience with GNU/Hurd :-) http://hurdvm.enanocms.org/
     $platform = 'GNU/Hurd';
-  else if(file_exists('C:\Windows\system32\ntoskrnl.exe'))
+  else if(strtolower(PHP_OS) == 'winnt')
     $platform = 'Windows NT';
-  else if(file_exists('C:\Windows\system\krnl386.exe'))
+  else if(strtolower(PHP_OS) == 'win32')
     $platform = 'Windows 9x/DOS';
   else if(file_exists('/System/Library/CoreServices/SystemVersion.plist'))
     $platform = 'Mac OS X';