Skip to content

Commit

Permalink
Change to is_callable for catching not public functions
Browse files Browse the repository at this point in the history
  • Loading branch information
bartdenhoed authored Feb 27, 2018
1 parent 85b368d commit 1121d24
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 1121d24

Please sign in to comment.