Fixed problems with $paths->getParam() on Win2k Server/IIS
authorDan
Mon, 09 Jul 2007 15:17:15 -0400
changeset 55 622d04f8719d
parent 54 84b56303cab5
child 56 eb8eacb056d1
Fixed problems with $paths->getParam() on Win2k Server/IIS
includes/paths.php
--- a/includes/paths.php	Sat Jul 07 23:06:28 2007 -0400
+++ b/includes/paths.php	Mon Jul 09 15:17:15 2007 -0400
@@ -513,7 +513,9 @@
   }
   function getParam($id = 0)
   {
-    if(isset($_SERVER['PATH_INFO']))
+    // using !empty here is a bugfix for IIS 5.x on Windows 2000 Server
+    // It may affect other IIS versions as well
+    if(isset($_SERVER['PATH_INFO']) && !empty($_SERVER['PATH_INFO']))
     {
       $pi = explode('/', $_SERVER['PATH_INFO']);
       $id = $id + 2;
@@ -532,7 +534,6 @@
       {
         if(substr($c, 0, 1) == '/')
         {
-          
           // Bugfix for apache somehow passing dots as underscores
           global $mime_types;
           $exts = array_keys($mime_types);
@@ -551,7 +552,9 @@
   
   function getAllParams()
   {
-    if(isset($_SERVER['PATH_INFO']))
+    // using !empty here is a bugfix for IIS 5.x on Windows 2000 Server
+    // It may affect other IIS versions as well
+    if(isset($_SERVER['PATH_INFO']) && !empty($_SERVER['PATH_INFO']))
     {
       $pi = explode('/', $_SERVER['PATH_INFO']);
       unset($pi[0], $pi[1]);