diff -ubr daily-2007-05-22/sapphire/core/control/Controller.php silverstripe/sapphire/core/control/Controller.php
--- daily-2007-05-22/sapphire/core/control/Controller.php	2007-05-22 08:33:09.000000000 +0200
+++ silverstripe/sapphire/core/control/Controller.php	2007-05-22 22:34:20.875000000 +0200
@@ -43,9 +43,8 @@
 		// Look at the action variables for forms
 		foreach($this->requestParams as $paramName => $paramVal) {
 			if(substr($paramName,0,7) == 'action_') {
-				$funcName = substr($paramName,7);
-				// Remove _x and _y from image fields
-				if(substr($funcName,-2) == '_x' || substr($funcName,-2) == '_y') $funcName = substr($funcName,0,-2);
+				// Cleanup action_, _x and _y from image fields
+				$funcName = preg_replace(array('/^action_/','/_x$|_y$/'),'',$funcName);
 				break;
 			}
 		}
diff -ubr daily-2007-05-22/sapphire/core/control/Director.php silverstripe/sapphire/core/control/Director.php
--- daily-2007-05-22/sapphire/core/control/Director.php	2007-05-21 08:19:31.000000000 +0200
+++ silverstripe/sapphire/core/control/Director.php	2007-05-22 23:08:38.546875000 +0200
@@ -55,10 +55,7 @@
 		
 	static function getControllerForURL($url) {
 		if(isset($_GET['debug_profile'])) Profiler::mark("Director","getControllerForURL");
-		$url = str_replace('//','/',$url);
-		
-		if($url[0] == '/') $url = substr($url,1);
-		if($url[strlen($url)-1] == '/') $url = substr($url,0,-1);
+		$url = preg_replace( array( '/\/+/','/^\//', '/\/$/'),array('/','',''),$url);
 		$urlParts = split('/+', $url);
 		
 		krsort(Director::$rules);
diff -ubr daily-2007-05-22/sapphire/core/control/RootURLController.php silverstripe/sapphire/core/control/RootURLController.php
--- daily-2007-05-22/sapphire/core/control/RootURLController.php	2007-05-16 02:26:18.000000000 +0200
+++ silverstripe/sapphire/core/control/RootURLController.php	2007-05-22 23:11:00.875000000 +0200
@@ -11,10 +11,8 @@
 		$homePageOBJ = DataObject::get_one("SiteTree", "HomepageForDomain = '$SQL_host'");
 		//die(print_r($homePageOBJ));
 		if($homePageOBJ) {
-		    $hpdom = $homePageOBJ->URLSegment;
-			Director::direct($hpdom);
+			Director::direct($homePageOBJ->URLSegment);
 		} else {
-			$hpdom = '/';
 			Director::direct('home/');
 		}
 	}
diff -ubr daily-2007-05-22/sapphire/main.php silverstripe/sapphire/main.php
--- daily-2007-05-22/sapphire/main.php	2007-05-22 08:31:49.000000000 +0200
+++ silverstripe/sapphire/main.php	2007-05-22 23:10:19.640625000 +0200
@@ -102,9 +102,10 @@
 if($homePageOBJ) {
 	$hpdom = $homePageOBJ->URLSegment;
 } else {
-	$hpdom = '/';
+	$hpdom = ''; // simply should be defined as if not will generate warning...
 }
 
+$surl = split('/',$url);
 $dir = new Director();
 if (($surl[1] != $hpdom) && ($surl[1] != 'home'))  { 
 	$dir->direct($url);

