return preg_replace("|^/*(.+?)/*$|", "\\1", $str);

to

return trim($str, '/');
diff --git a/system/helpers/string_helper.php b/system/helpers/string_helper.php
index 04c3a59..011be23 100644
--- a/system/helpers/string_helper.php
+++ b/system/helpers/string_helper.php
@@ -44,8 +44,8 @@
  */	

 function trim_slashes($str)

 {

-	return preg_replace("|^/*(.+?)/*$|", "\\1", $str);

-}

+    return trim($str, '/');

+} 

 	

 // ------------------------------------------------------------------------