Skip to content

Commit

Permalink
Preserve previous behavior which silently discards errors when fopen …
Browse files Browse the repository at this point in the history
…fails on PHP 8.0
  • Loading branch information
marcovtwout committed Nov 24, 2021
1 parent b9991a3 commit d62894e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Version 1.1.25 under development
- Bug #4369: PHP 8.0 compatibility: Fix warning "Only the first byte will be assigned to the string offset" when generating code with Gii (marcovtwout)
- Bug #4374: Fix for createUpdateCommand which did not accept just a table name when using MSSQL (c-schmitz)
- Bug #4380: Prevent fatal errors while validating CSRF token of malformed requests (rob006)
- Bug #4382: PHP 8.0 compatibility: Fix CFileLogRoute throwing TypeError when logfile cannot be opened (marcovtwout)

Version 1.1.24 June 7, 2021
--------------------------------
Expand Down
3 changes: 3 additions & 0 deletions framework/logging/CFileLogRoute.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ protected function processLogs($logs)

$logFile=$this->getLogPath().DIRECTORY_SEPARATOR.$this->getLogFile();
$fp=@fopen($logFile,'a');
if($fp===false)
return;

@flock($fp,LOCK_EX);
if(@filesize($logFile)>$this->getMaxFileSize()*1024)
{
Expand Down

0 comments on commit d62894e

Please sign in to comment.