PHP Error mkdir() with fix
-
Hi,
Have some php errors in iThemes Security 5.3.7 but already fixed it in CORE. It would be cool if you add fixes in next release.
See below
PHP Error
Warning mkdir() [function.mkdir]: File exists
Location wp-content/plugins/better-wp-security/core/class-itsec-files.php:331
Call Stack
mkdir()
wp-content/plugins/better-wp-security/core/class-itsec-files.php:331
ITSEC_Files->get_file_lock()
wp-content/plugins/better-wp-security/core/modules/file-change/class-itsec-file-change.php:169
ITSEC_File_Change->execute_file_check()
Unknown location
do_action(‘init’)
wp-settings.php:392SOLUTION
// add a check whether directory is already exists before making new directory at wp-content/plugins/better-wp-security/core/class-itsec-files.php:331if ( ! @is_dir( $lock_file ) ) { @mkdir( $lock_file ); } else { // if ( false === @mkdir( $lock_file ) ) { if ( false !== $dir_age ) { if ( ( time() - $dir_age ) > intval( $exp ) ) { //see if the lock has expired @rmdir( $lock_file ); @mkdir( $lock_file ); } else { //couldn't get the lock return false; } } else { return false; } }Andrey
The topic ‘PHP Error mkdir() with fix’ is closed to new replies.