Skip to content

Commit

Permalink
Merge pull request #2 from electricfunction/master
Browse files Browse the repository at this point in the history
Don’t throw warning when logging an array in data_var().
  • Loading branch information
josev814 committed Oct 30, 2015
2 parents b66e348 + e4295f6 commit 16b9d94
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/libraries/app_hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,11 @@ public function data ($type, $id) {
public function data_var ($name, $value) {
$this->data[$name] = $value;

if (is_array($value)) {
// prevent errors in log_message() below
$value = serialize($value);
}

@log_message('debug', 'Hook: "' . $name . '" => "' . $value . '" data registered to active hook.');

return;
Expand Down

0 comments on commit 16b9d94

Please sign in to comment.