Browse Source

Adding patch from Ticket #1354

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4223 3807eeeb-6ff5-0310-8944-8be069107fe0
phpnut 19 years ago
parent
commit
dfbc6f0706
1 changed files with 1 additions and 10 deletions
  1. 1 10
      cake/basics.php

+ 1 - 10
cake/basics.php

@@ -1331,18 +1331,9 @@
  * @return string with underscore remove from start and end of string
  */
 	function convertSlash($string) {
+		$string = trim($string,"/");
 		$string = preg_replace('/\/\//', '/', $string);
 		$string = str_replace('/', '_', $string);
-		$pos = strpos($string, '_');
-		$pos1 = strrpos($string, '_');
-		$char = strlen($string) - 1;
-		if ($pos1 == $char) {
-			$string = substr($string, 0, $char);
-		}
-
-		if ($pos === 0) {
-			$string = substr($string, 1);
-		}
 		return $string;
 	}
 /**