Skip to content

Commit

Permalink
change to wp_is_writable()
Browse files Browse the repository at this point in the history
change is_writable and is_writeable to wp_is_writable to workaround windows ACL issues
  • Loading branch information
ProjectPatatoe authored Jun 27, 2022
1 parent f7f1ed9 commit bf414b2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions wp-db-backup.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -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' ) );
Expand Down Expand Up @@ -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' ) );
Expand Down Expand Up @@ -1219,7 +1219,7 @@ function backup_menu() {
<?php
// not writable due to write permissions
$whoops = true;
} elseif ( ! is_writable( $this->backup_dir ) && ! @chmod( $this->backup_dir, $dir_perms ) ) {
} elseif ( ! wp_is_writable( $this->backup_dir ) && ! @chmod( $this->backup_dir, $dir_perms ) ) {
?>
<div class="wp-db-backup-updated error inline">
<p><?php _e( 'WARNING: Your backup directory is <strong>NOT</strong> writable! We cannot create the backup files.', 'wp-db-backup' ); ?></p>
Expand Down

0 comments on commit bf414b2

Please sign in to comment.