Adding patch from Ticket #1354

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4223 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
phpnut 2006-12-28 05:15:21 +00:00
parent 0ab73bb5fa
commit dfbc6f0706

View file

@ -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;
}
/**