0001-Strip-front-controller-from-requested-URI-only-when.patch

against trunk - Chris Bandy, 05/14/2009 10:51 am

Download (1.1 kB)

 
system/libraries/Router.php (working copy)
213 213
		elseif (isset($_SERVER['PHP_SELF']) AND $_SERVER['PHP_SELF'])
214 214
		{
215 215
			Router::$current_uri = $_SERVER['PHP_SELF'];
216
		}
217

  
218
		// The front controller directory and filename
219
		$fc = substr(realpath($_SERVER['SCRIPT_FILENAME']), strlen(DOCROOT));
220 216

  
221
		if (($strpos_fc = strpos(Router::$current_uri, $fc)) !== FALSE)
222
		{
223
			// Remove the front controller from the current uri
224
			Router::$current_uri = substr(Router::$current_uri, $strpos_fc + strlen($fc));
217
			if (($strpos_fc = strpos(Router::$current_uri, KOHANA)) !== FALSE)
218
			{
219
				// Remove the front controller from the current uri
220
				Router::$current_uri = substr(Router::$current_uri, $strpos_fc + strlen(KOHANA));
221
			}
225 222
		}
226 223

  
227 224
		// Remove slashes from the start and end of the URI