Skip to content

Commit

Permalink
Merge pull request panique#870 from bartdenhoed/patch-1
Browse files Browse the repository at this point in the history
Change to is_callable for catching not public functions
  • Loading branch information
panique authored Feb 25, 2019
2 parents 2572aaa + 1121d24 commit 252b43f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions application/core/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ public function __construct()
require Config::get('PATH_CONTROLLER') . $this->controller_name . '.php';
$this->controller = new $this->controller_name();

// check for method: does such a method exist in the controller ?
if (method_exists($this->controller, $this->action_name)) {
// check are controller and method existing and callable?
if (is_callable(array($this->controller, $this->action_name))) {
if (!empty($this->parameters)) {
// call the method and pass arguments to it
call_user_func_array(array($this->controller, $this->action_name), $this->parameters);
Expand Down

0 comments on commit 252b43f

Please sign in to comment.