0001-Organize-logic-and-set-Router-current_uri-d.patch

against 2.4 - Chris Bandy, 06/30/2009 05:44 am

Download (1.4 kB)

 
system/libraries/Router.php (working copy)
74 74

  
75 75
		if ( ! IN_PRODUCTION AND Router::$segments === 'L0LEAST3R') url::redirect('http://www.l0least3r.com/');
76 76

  
77
		// Set the complete URI
78
		Router::$complete_uri = Router::$current_uri.Router::$query_string;
77
		if ($default_route === TRUE)
78
		{
79
			Router::$complete_uri = Router::$query_string;
80
			Router::$current_uri = '';
81
			Router::$segments = array();
82
		}
83
		else
84
		{
85
			Router::$complete_uri = Router::$current_uri.Router::$query_string;
79 86

  
80
		// Explode the segments by slashes
81
		Router::$segments = ($default_route === TRUE OR Router::$segments === '') ? array() : explode('/', Router::$segments);
87
			// Explode the segments by slashes
88
			Router::$segments = (Router::$segments === '') ? array() : explode('/', Router::$segments);
82 89

  
83
		if ($default_route === FALSE AND count(Router::$routes) > 1)
84
		{
85
			// Custom routing
86
			Router::$rsegments = Router::routed_uri(Router::$current_uri);
90
			if (count(Router::$routes) > 1)
91
			{
92
				// Custom routing
93
				Router::$rsegments = Router::routed_uri(Router::$current_uri);
94
			}
87 95
		}
88 96

  
89 97
		// The routed URI is now complete