Bug found in source code of plugin
-
While checking the error_log file of a website, I have found a bug in the source code of this plugin:
[16-May-2024 19:25:28 UTC] PHP Warning: require(/home/rightsan/rr.bracketserver.com/wp-content/plugins/media-file-renamer/classes/admin.php): Failed to open stream: No such file or directory in /home/rightsan/rr.bracketserver.com/wp-content/plugins/media-file-renamer/classes/init.php on line 32
The code in question is this:if ( $file ) {
if ( !$necessary && !file_exists( $file ) ) {
return;
}
require( $file );
I think the second if statement is wrong.
It should be as follows:
if ( !$necessary || !file_exists( $file ) ) {
because as it is right now, if $necessary is set to true, it will try to open the file although the file doesn’t exist, causing the aforementioned warningThe page I need help with: [log in to see the link]
- You must be logged in to reply to this topic.