MantisBT: master-2.21 1c1ffd3b

Author Committer Branch Timestamp Parent
dregad GitHub master-2.21 2019-05-05 08:34 master 78b3a4f0
Affected Issues  0019642: If log file is not writable, log_event() fails silently
 0025734: LOGFILE_NOT_WRITABLE error triggered if file does not exist
Changeset

log_event() create log file if it does not exist (0001509)

log_event() create log file if it does not exist

This is a regression from issue 0019642. When MantisBT tries to write an
event to a log file that does not already exist, a warning is printed
and the file is not created even if PHP process has write access to the
directory. The event is added to the PHP system log.

Instead of relying on is_writable(), the code now calls error_log() with
errors suppressed, then checks the result of the function call to
determine if the operation was successful or not.

Fixes 0025734

mod - core/logging_api.php Diff File