Allow use of dashes in controller/method URI segments

Supersedes PR #642
diff --git a/system/core/Router.php b/system/core/Router.php
index 87f3e9e..89fb74f 100644
--- a/system/core/Router.php
+++ b/system/core/Router.php
@@ -190,6 +190,7 @@
 		{
 			show_error('Unable to determine what should be displayed. A default route has not been specified in the routing file.');
 		}
+
 		// Is the method being specified?
 		if (strpos($this->default_controller, '/') !== FALSE)
 		{
@@ -268,9 +269,13 @@
 			return $segments;
 		}
 
+		$temp = str_replace('-', '_', $segments[0]);
+
 		// Does the requested controller exist in the root folder?
-		if (file_exists(APPPATH.'controllers/'.$segments[0].'.php'))
+		if (file_exists(APPPATH.'controllers/'.$temp.'.php'))
 		{
+			$segments[0] = $temp;
+			empty($segments[1]) OR $segments[1] = str_replace('-', '_', $segments[1]);
 			return $segments;
 		}
 
@@ -283,6 +288,9 @@
 
 			if (count($segments) > 0)
 			{
+				$segments[0] = str_replace('-', '_', $segments[0]);
+				empty($segments[1]) OR $segments[1] = str_replace('-', '_', $segments[1]);
+
 				// Does the requested controller exist in the sub-folder?
 				if ( ! file_exists(APPPATH.'controllers/'.$this->fetch_directory().$segments[0].'.php'))
 				{