xray7224/MegMVC — Issue #1: Behaviour of Loader.php
Author: mathias-steiger
Created: 2012-03-04 17:59:02+00:00
State: open

Bug report as requested:

What is the purpose of this code?

if ($_GET) {
$controller[2] = $_GET["q"];
}
[...]
if (count($controller) > 2) {
$rins->$controller[1](array_slice($controller, 2));
} else {
$rins->$controller[1]();
}

To illustrate:

$_SERVER["PATH_INFO"] = "/Index/path123/info456";
$_GET["q"] = "getq";
=>
$controller[0] = "Index";
$controller[1] = "path123";
$controller[2] = "getq";
=>
$rins->"path123"(array("getq"));
} else {
$rins->"path123"();
}

Also, letting users call arbitrary class methods is allegedly insecure, because of magic methods in PHP (though, I wouldn't know how that could be possible).