From bf414b217c14ea5fbee170f31ba56a31d07f918c Mon Sep 17 00:00:00 2001 From: Patrick B <27925441+ProjectPatatoe@users.noreply.github.com> Date: Mon, 27 Jun 2022 16:28:33 -0700 Subject: [PATCH] change to wp_is_writable() change is_writable and is_writeable to wp_is_writable to workaround windows ACL issues --- wp-db-backup.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wp-db-backup.php b/wp-db-backup.php index 525db09..33af520 100755 --- a/wp-db-backup.php +++ b/wp-db-backup.php @@ -120,7 +120,7 @@ function __construct() { if ( isset( $_GET['wp_db_temp_dir'] ) ) { $requested_dir = sanitize_text_field( $_GET['wp_db_temp_dir'] ); - if ( is_writeable( $requested_dir ) ) { + if ( wp_is_writable ( $requested_dir ) ) { $tmp_dir = $requested_dir; } } @@ -421,7 +421,7 @@ function backup_fragment( $table, $segment, $filename ) { } } - if ( is_writable( $this->backup_dir ) ) { + if ( wp_is_writable( $this->backup_dir ) ) { $this->fp = $this->open( $this->backup_dir . $filename, 'a' ); if ( ! $this->fp ) { $this->error( __( 'Could not open the backup file for writing!', 'wp-db-backup' ) ); @@ -957,7 +957,7 @@ function backup_table( $table, $segment = 'none' ) { function db_backup( $core_tables, $other_tables ) { global $table_prefix, $wpdb; - if ( is_writable( $this->backup_dir ) ) { + if ( wp_is_writable( $this->backup_dir ) ) { $this->fp = $this->open( $this->backup_dir . $this->backup_filename ); if ( ! $this->fp ) { $this->error( __( 'Could not open the backup file for writing!', 'wp-db-backup' ) ); @@ -1219,7 +1219,7 @@ function backup_menu() { backup_dir ) && ! @chmod( $this->backup_dir, $dir_perms ) ) { + } elseif ( ! wp_is_writable( $this->backup_dir ) && ! @chmod( $this->backup_dir, $dir_perms ) ) { ?>
NOT writable! We cannot create the backup files.', 'wp-db-backup' ); ?>