Skip to content

Commit

Permalink
Check fopen() result before writing lock file
Browse files Browse the repository at this point in the history
  • Loading branch information
dvz committed Jul 5, 2023
1 parent a4dc072 commit 7e5c23e
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions install/index.php
Expand Up @@ -2485,11 +2485,16 @@ function install_done()
if(is_writable('./'))
{
$lock = @fopen('./lock', 'w');
$written = @fwrite($lock, '1');
@fclose($lock);
if($written)

if($lock !== false)
{
echo $lang->done_step_locked;
$written = @fwrite($lock, '1');
@fclose($lock);

if($written)
{
echo $lang->done_step_locked;
}
}
}
if(!$written)
Expand Down

0 comments on commit 7e5c23e

Please sign in to comment.