Commits

Anonymous committed 097f12c

  • Participants
  • Parent commits fec3e12

Comments (0)

Files changed (2)

system/libraries/Config.php

 	function system_url()
 	{
 		$x = explode("/", preg_replace("|/*(.+?)/*$|", "\\1", BASEPATH));
-		return $this->item('base_url', 1).end($x).'/';
+		return $this->slash_item('base_url').end($x).'/';
 	}
   	// END system_url()
   	

system/libraries/Router.php

 			$key = str_replace(':any', '.+', str_replace(':num', '[0-9]+', $key));
 			
 			// Does the RegEx match?
-			if (preg_match('|^'.$key.'$|', $uri))
+			if (preg_match('#^'.preg_quote($key).'$#', $uri))
 			{			
 				// Do we have a back-reference?
 				if (strpos($val, '$') !== FALSE AND strpos($key, '(') !== FALSE)
 				{
-					$val = preg_replace('|^'.$key.'$|', $val, $uri);
+					$val = preg_replace('#^'.preg_quote($key).'$#', $val, $uri);
 				}
 			
 				$this->_compile_segments(explode('/', $val));