diff options
author | redmatrix <redmatrix@redmatrix.me> | 2015-11-15 19:36:17 -0800 |
---|---|---|
committer | redmatrix <redmatrix@redmatrix.me> | 2015-11-15 19:36:17 -0800 |
commit | fff30b1c3d7030ff63c880c13bcb47e2932cd1b8 (patch) | |
tree | fdab5272c37b5321c544475ca60c3ccc5a0efa02 /include | |
parent | 6ad35e3d843bbc0483e21ed6f31c8942513290b6 (diff) | |
download | volse-hubzilla-fff30b1c3d7030ff63c880c13bcb47e2932cd1b8.tar.gz volse-hubzilla-fff30b1c3d7030ff63c880c13bcb47e2932cd1b8.tar.bz2 volse-hubzilla-fff30b1c3d7030ff63c880c13bcb47e2932cd1b8.zip |
permission issues editing wall-to-wall posts
Diffstat (limited to 'include')
-rw-r--r-- | include/text.php | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/include/text.php b/include/text.php index ed0e21a71..166dbb4fb 100644 --- a/include/text.php +++ b/include/text.php @@ -531,11 +531,12 @@ function attribute_contains($attr, $s) { * LOGGER_DATA and LOGGER_ALL. * * Since PHP5.4 we get the file, function and line automatically where the logger - * was caleld, so no need to add it to the message anymore. + * was called, so no need to add it to the message anymore. * * @param string $msg Message to log * @param int $level A log level. */ + function logger($msg, $level = 0) { // turn off logger in install mode global $a; @@ -557,7 +558,13 @@ function logger($msg, $level = 0) { $where = basename($stack[0]['file']) . ':' . $stack[0]['line'] . ':' . $stack[1]['function'] . ': '; } - @file_put_contents($logfile, datetime_convert() . ':' . session_id() . ' ' . $where . $msg . PHP_EOL, FILE_APPEND); + $s = datetime_convert() . ':' . session_id() . ' ' . $where . $msg . PHP_EOL; + $pluginfo = array('filename' => $logfile, 'loglevel' => $level, 'message' => $s,'logged' => false); + + call_hooks('logger',$pluginfo); + + if(! $pluginfo['logged']) + @file_put_contents($logfile, $s, FILE_APPEND); } /** |