mirror of
https://git.code.sf.net/p/seeddms/code
synced 2024-11-26 15:32:13 +00:00
check if method specified in 'action' is public
This commit is contained in:
parent
dd40e979e7
commit
4b761a95a1
|
@ -73,7 +73,13 @@ class SeedDMS_Controller_Common {
|
|||
if(!$this->callHook('preRun', get_class($this), $action ? $action : 'run')) {
|
||||
if($action) {
|
||||
if(method_exists($this, $action)) {
|
||||
return $this->{$action}();
|
||||
$refl = new ReflectionMethod($this, $action);
|
||||
if($refl->isPublic())
|
||||
return $this->{$action}();
|
||||
else {
|
||||
echo "Action '".$action."' not public";
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
echo "Missing action '".$action."'";
|
||||
return false;
|
||||
|
|
|
@ -69,7 +69,13 @@ class SeedDMS_View_Common {
|
|||
if(!$this->callHook('preRun', get_class($this), $action ? $action : 'show')) {
|
||||
if($action) {
|
||||
if(method_exists($this, $action)) {
|
||||
$this->{$action}();
|
||||
$refl = new ReflectionMethod($this, $action);
|
||||
if($refl->isPublic())
|
||||
$this->{$action}();
|
||||
else {
|
||||
echo "Action '".$action."' not public";
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
echo "Missing action '".htmlspecialchars($action)."'";
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user