mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-19 08:01:39 +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(!$this->callHook('preRun', get_class($this), $action ? $action : 'run')) {
|
||||||
if($action) {
|
if($action) {
|
||||||
if(method_exists($this, $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 {
|
} else {
|
||||||
echo "Missing action '".$action."'";
|
echo "Missing action '".$action."'";
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -69,7 +69,13 @@ class SeedDMS_View_Common {
|
||||||
if(!$this->callHook('preRun', get_class($this), $action ? $action : 'show')) {
|
if(!$this->callHook('preRun', get_class($this), $action ? $action : 'show')) {
|
||||||
if($action) {
|
if($action) {
|
||||||
if(method_exists($this, $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 {
|
} else {
|
||||||
echo "Missing action '".htmlspecialchars($action)."'";
|
echo "Missing action '".htmlspecialchars($action)."'";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user