Skip to content

Commit

Permalink
Respect 'exit()' in callback (#151)
Browse files Browse the repository at this point in the history
  • Loading branch information
romaninsh authored and DarkSide666 committed Apr 28, 2017
1 parent 168cdbe commit 2108eac
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/Callback.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,23 @@ public function set($callback, $args = [])
if (isset($_POST[$this->name])) {
$this->triggered = $_POST[$this->name];

return call_user_func_array($callback, $args);
$t = $this->app->run_called;
$this->app->run_called = true;
$ret = call_user_func_array($callback, $args);
$this->app->run_called = $t;

return $ret;
}
} else {
if (isset($_GET[$this->name])) {
$this->triggered = $_GET[$this->name];

return call_user_func_array($callback, $args);
$t = $this->app->run_called;
$this->app->run_called = true;
$ret = call_user_func_array($callback, $args);
$this->app->run_called = $t;

return $ret;
}
}
}
Expand Down

0 comments on commit 2108eac

Please sign in to comment.