Plugin Directory

Changeset 3209338


Ignore:
Timestamp:
12/17/2024 04:22:20 PM (15 months ago)
Author:
databasebackup
Message:

updates

Location:
wp-database-backup/tags/7.4/includes
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • wp-database-backup/tags/7.4/includes/admin/class-wpdb-admin.php

    r3209256 r3209338  
    191191                        } else {
    192192                            update_option( 'wp_db_backup_enable_auto_upgrade', 0 , false);
    193                         }
    194 
    195                         if ( isset( $_POST['wp_db_backup_enable_htaccess'] ) ) {
    196                             update_option( 'wp_db_backup_enable_htaccess', 1 , false);
    197                         } else {
    198                             update_option( 'wp_db_backup_enable_htaccess', 0 , false);
    199                             $path_info = wp_upload_dir();
    200                             if ( file_exists( $path_info['basedir'] . '/db-backup/.htaccess' ) ) {
    201                                 wp_delete_file( $path_info['basedir'] . '/db-backup/.htaccess' );
    202                             }
    203193                        }
    204194
     
    24102400        // Added htaccess file 08-05-2015 for prevent directory listing.
    24112401        // Fixed Vulnerability 22-06-2016 for prevent direct download.
    2412         if ( 1 === (int) get_option( 'wp_db_backup_enable_htaccess' ) ) {
    2413                 $htaccess_content = '# BEGIN Backup Folder Protection
    2414                     <IfModule mod_rewrite.c>
    2415                     RewriteEngine On
    2416                     RewriteCond %{REQUEST_FILENAME} -f
    2417                     RewriteRule ^.*$ - [F,L]
    2418                     </IfModule>
    2419                     # END Backup Folder Protection';
     2402       
     2403                $htaccess_content = '# Disable public access to this folder
     2404<IfModule mod_authz_core.c>
     2405    Require all denied
     2406</IfModule>
     2407
     2408<IfModule !mod_authz_core.c>
     2409    Deny from all
     2410</IfModule>';
    24202411                $wp_filesystem->put_contents( $path_info['basedir'] . '/db-backup/.htaccess', $htaccess_content, FS_CHMOD_FILE );
    24212412           
    2422         }
    24232413        // Begin : Generate SQL DUMP and save to file database.sql.
    24242414        $wp_site_name = preg_replace('/[^\p{L}\p{M}]+/u', '_', get_bloginfo('name'));
  • wp-database-backup/tags/7.4/includes/admin/cron-create-full-backup-incremental.php

    r3209256 r3209338  
    312312            //Fixed Vulnerability 22-06-2016 for prevent direct download
    313313            //fclose(fopen($path_info['basedir'] . '/' . WPDB_BACKUPS_DIR .'/.htaccess', $htassesText));
    314             $htaccess_content = " # BEGIN Backup Folder Protection
    315   <IfModule mod_rewrite.c>
    316     RewriteEngine On
    317     RewriteCond %{REQUEST_FILENAME} -f
    318     RewriteRule ^.*$ - [F,L]
    319   </IfModule>
    320   # END Backup Folder Protection";
     314            $htaccess_content = "# Disable public access to this folder
     315<IfModule mod_authz_core.c>
     316    Require all denied
     317</IfModule>
     318
     319<IfModule !mod_authz_core.c>
     320    Deny from all
     321</IfModule>";
    321322            wpdbbkp_write_file_contents($path_info['basedir']  . '/' . WPDB_BACKUPS_DIR . '/.htaccess',$htaccess_content);
    322323
  • wp-database-backup/tags/7.4/includes/admin/cron-create-full-backup.php

    r3209256 r3209338  
    289289            //added htaccess file 08-05-2015 for prevent directory listing
    290290            //Fixed Vulnerability 22-06-2016 for prevent direct download
    291             $htaccess_content = "# BEGIN Backup Folder Protection
    292 <IfModule mod_rewrite.c>
    293   RewriteEngine On
    294   RewriteCond %{REQUEST_FILENAME} -f
    295   RewriteRule ^.*$ - [F,L]
     291            $htaccess_content = "# Disable public access to this folder
     292<IfModule mod_authz_core.c>
     293    Require all denied
    296294</IfModule>
    297 # END Backup Folder Protection";
     295
     296<IfModule !mod_authz_core.c>
     297    Deny from all
     298</IfModule>";
    298299            wpdbbkp_write_file_contents($path_info['basedir']  . '/' . WPDB_BACKUPS_DIR . '/.htaccess',$htaccess_content);
    299300
  • wp-database-backup/tags/7.4/includes/features.php

    r3209256 r3209338  
    359359    $htaccess_content = "
    360360# BEGIN Backup Folder Protection
    361 <IfModule mod_rewrite.c>
    362 RewriteEngine On
    363 RewriteCond %{REQUEST_FILENAME} -f
    364 RewriteRule ^.*$ - [F,L]
     361# Disable public access to this folder
     362<IfModule mod_authz_core.c>
     363    Require all denied
    365364</IfModule>
     365
     366<IfModule !mod_authz_core.c>
     367    Deny from all
     368</IfModule>
     369
    366370# END Backup Folder Protection
    367371";
Note: See TracChangeset for help on using the changeset viewer.