Skip to content

Commit f7811b9

Browse files
committed
Fix notice when handling c3 error before C3_CODECOVERAGE_MEDIATE_STORAGE is defined
1 parent 6253181 commit f7811b9

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

c3.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,13 @@
3838
if (!function_exists('__c3_error')) {
3939
function __c3_error($message)
4040
{
41-
$errorLogFile = defined('C3_CODECOVERAGE_ERROR_LOG_FILE') ?
42-
C3_CODECOVERAGE_ERROR_LOG_FILE :
43-
C3_CODECOVERAGE_MEDIATE_STORAGE . DIRECTORY_SEPARATOR . 'error.txt';
41+
if (defined('C3_CODECOVERAGE_ERROR_LOG_FILE')) {
42+
$errorLogFile = C3_CODECOVERAGE_ERROR_LOG_FILE;
43+
} elseif (defined('C3_CODECOVERAGE_MEDIATE_STORAGE')) {
44+
$errorLogFile = C3_CODECOVERAGE_MEDIATE_STORAGE . DIRECTORY_SEPARATOR . 'error.txt';
45+
} else {
46+
$errorLogFile = null;
47+
}
4448
if (is_writable($errorLogFile)) {
4549
file_put_contents($errorLogFile, $message);
4650
} else {

0 commit comments

Comments
 (0)