You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't recall seeing this in earlier PHP versions, but at least in PHP 8.2, if the $backup_file argument for safe_file_write() is null, errors will be generated on line 1874 about file_exists() not liking null arguments, and then on line 1929 about $temp_bfile not being defined.
Steps to reproduce
Write some code that calls safe_file_write($file, $data) (note the lack of a $backup_file argument).
Run that code.
Environment (complete as necessary)
Version/Git revision: 2.1.4
Database Type: N/A
Database Version: N/A
PHP Version: 8.2.5
Additional information/references
SMF itself doesn't encounter this bug because we always call safe_file_write() with the $backup_file argument set to a file path. But I ran into it while testing updates to a mod that calls the function without a $backup_file argument.
The text was updated successfully, but these errors were encountered:
Description
I don't recall seeing this in earlier PHP versions, but at least in PHP 8.2, if the
$backup_file
argument forsafe_file_write()
is null, errors will be generated on line 1874 aboutfile_exists()
not liking null arguments, and then on line 1929 about$temp_bfile
not being defined.Steps to reproduce
safe_file_write($file, $data)
(note the lack of a$backup_file
argument).Environment (complete as necessary)
Additional information/references
SMF itself doesn't encounter this bug because we always call
safe_file_write()
with the$backup_file
argument set to a file path. But I ran into it while testing updates to a mod that calls the function without a$backup_file
argument.The text was updated successfully, but these errors were encountered: