Skip to content

Commit c6afe89

Browse files
committed
Fix php logging warnings
1 parent 0b0e8d0 commit c6afe89

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Logging.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ public function lwrite($message, $type, $pid = NULL, $dsid = NULL, $user = NULL,
3333
}
3434
// close log file (it's always a good idea to close a file when you're done with it)
3535
public function lclose() {
36-
fclose($this->fp);
36+
// Only close if necessary (prevents php warnings)
37+
if ($this->fp) {
38+
fclose($this->fp);
39+
}
3740
}
3841
// open log file (private method)
3942
private function lopen() {

0 commit comments

Comments
 (0)