public/wordpress/wp-content/plugins/backupbuddy/classes/core.php
/* verify_directories()
	 *
	 * Verify existance and security of key directories. Result available via global $pb_backupbuddy_directory_verification with return value.
	 *
	 * @return		bool		true on success creating / verifying, else false.
	 *
	 */
verify_directories()
Verify existance and security of key directories. Result available via global $pb_backupbuddy_directory_verification with return value.

@return              bool            true on success creating / verifying, else false.
verify_directories () Verify existance and security of key directories . Result available via global $pb_backupbuddy_directory_verification with return value . @return bool true on success creating / verifying else false .
public static function verify_directories( $skipTempGeneration = false ) {
		$success = true;
		if ( ! @is_writable( backupbuddy_core::getBackupDirectory() ) ) {
			pb_backupbuddy::status( 'details', 'Backup directory invalid. Updating from `' . backupbuddy_core::getBackupDirectory() . '` to default.' );
			pb_backupbuddy::$options['backup_directory'] = ''; 
			pb_backupbuddy::save();
		}
		$response = pb_backupbuddy::anti_directory_browsing( backupbuddy_core::getBackupDirectory(), $die = false );
		if ( false === $response ) {
			$success = false;
		}
		if ( ! @is_writable( backupbuddy_core::getLogDirectory() ) ) {
			pb_backupbuddy::status( 'details', 'Log directory invalid. Updating from `' . backupbuddy_core::getLogDirectory() . '` to default.' );
			pb_backupbuddy::$options['log_directory'] = ''; 
			pb_backupbuddy::save();
		}
		pb_backupbuddy::anti_directory_browsing( backupbuddy_core::getLogDirectory(), $die = false );
		if ( false === $response ) {
			$success = false;
		}
		if ( true !== $skipTempGeneration ) {
			if ( ! @is_writable( backupbuddy_core::getTempDirectory() ) ) {
				pb_backupbuddy::status( 'details', 'Temporary directory invalid. Updating from `' . backupbuddy_core::getTempDirectory() . '` to default.' );
				pb_backupbuddy::$options['temp_directory'] = '';
				pb_backupbuddy::save();
			}
			pb_backupbuddy::anti_directory_browsing( backupbuddy_core::getTempDirectory(), $die = false );
			if ( false === $response ) {
				$success = false;
			}
		}
		if ( file_exists( backupbuddy_core::getTempDirectory() ) ) {
			pb_backupbuddy::anti_directory_browsing( backupbuddy_core::getTempDirectory(), $die = false );
		}
		global $pb_backupbuddy_directory_verification;
		$pb_backupbuddy_directory_verification = $success;
		return $success;
	}
public static function verify_directories ( $ skipTempGeneration = false ) { $ success = true ; if ( ! @ is_writable ( backupbuddy_core :: getBackupDirectory ( ) ) ) { pb_backupbuddy :: status ( 'details' , 'Backup directory invalid. Updating from `' . backupbuddy_core :: getBackupDirectory ( ) . '` to default.' ) ; pb_backupbuddy :: $ options [ 'backup_directory' ] = '' ; pb_backupbuddy :: save ( ) ; } $ response = pb_backupbuddy :: anti_directory_browsing ( backupbuddy_core :: getBackupDirectory ( ) , $ die = false ) ; if ( false === $ response ) { $ success = false ; } if ( ! @ is_writable ( backupbuddy_core :: getLogDirectory ( ) ) ) { pb_backupbuddy :: status ( 'details' , 'Log directory invalid. Updating from `' . backupbuddy_core :: getLogDirectory ( ) . '` to default.' ) ; pb_backupbuddy :: $ options [ 'log_directory' ] = '' ; pb_backupbuddy :: save ( ) ; } pb_backupbuddy :: anti_directory_browsing ( backupbuddy_core :: getLogDirectory ( ) , $ die = false ) ; if ( false === $ response ) { $ success = false ; } if ( true !== $ skipTempGeneration ) { if ( ! @ is_writable ( backupbuddy_core :: getTempDirectory ( ) ) ) { pb_backupbuddy :: status ( 'details' , 'Temporary directory invalid. Updating from `' . backupbuddy_core :: getTempDirectory ( ) . '` to default.' ) ; pb_backupbuddy :: $ options [ 'temp_directory' ] = '' ; pb_backupbuddy :: save ( ) ; } pb_backupbuddy :: anti_directory_browsing ( backupbuddy_core :: getTempDirectory ( ) , $ die = false ) ; if ( false === $ response ) { $ success = false ; } } if ( file_exists ( backupbuddy_core :: getTempDirectory ( ) ) ) { pb_backupbuddy :: anti_directory_browsing ( backupbuddy_core :: getTempDirectory ( ) , $ die = false ) ; } global $ pb_backupbuddy_directory_verification ; $ pb_backupbuddy_directory_verification = $ success ; return $ success ; }
verify_directories()
 Verify existance and security of key directories.
verify_directories () Verify existance and security of key directories .
// Update backup directory if unable to write to the defined one. // Reset to default (blank). // Update log directory if unable to write to the defined one. // Reset to default (blank). // Update temp directory if unable to write to the defined one. // If temp directory exists (should only be transient but just in case it is hanging around) make sure it's secured. BB will try to delete this directory but if it can't it will at least be checked to be secure.