Read action inside router
Read action inside router

--- a/include/Router.class.php
+++ b/include/Router.class.php
@@ -12,11 +12,14 @@
 	/**
 	 * Gets a controller for an action
 	 *
-	 * @param string $action action
 	 * @return mixed controller object
 	 */
-	public static function GetController($action)
+	public static function GetController()
 	{
+		$action = null;
+		if (isset($_GET['a']))
+			$action = $_GET['a'];
+
 		$controller = null;
 
 		switch ($action) {

file:a/index.php -> file:b/index.php
--- a/index.php
+++ b/index.php
@@ -44,7 +44,7 @@
 
 try {
 
-	$controller = GitPHP_Router::GetController((isset($_GET['a']) ? $_GET['a'] : null));
+	$controller = GitPHP_Router::GetController();
 	if ($controller) {
 		$controller->RenderHeaders();
 		$controller->Render();

comments