Commits

Eric Barnes committed c72660c

Changed server check to ensure SCRIPT_NAME is defined. Fixes #57

  • Participants
  • Parent commits caf7640

Comments (0)

Files changed (1)

system/core/URI.php

 		$path = (isset($_SERVER[$uri])) ? $_SERVER[$uri] : @getenv($uri);
 		$this->_set_uri_string($path);
 	}
-	
+
 	// --------------------------------------------------------------------
 
 	/**
 	{
 		// Filter out control characters
 		$str = remove_invisible_characters($str, FALSE);
-		
+
 		// If the URI contains only a slash we'll kill it
 		$this->uri_string = ($str == '/') ? '' : $str;
 	}
 	 */
 	private function _detect_uri()
 	{
-		if ( ! isset($_SERVER['REQUEST_URI']))
+		if ( ! isset($_SERVER['REQUEST_URI']) OR ! isset($_SERVER['SCRIPT_NAME']))
 		{
 			return '';
 		}
 			$_SERVER['QUERY_STRING'] = '';
 			$_GET = array();
 		}
-		
+
 		if ($uri == '/' || empty($uri))
 		{
 			return '/';
 		}
-				
+
 		$uri = parse_url($uri, PHP_URL_PATH);
 
 		// Do some final cleaning of the URI and return it