Changeset 3209338
- Timestamp:
- 12/17/2024 04:22:20 PM (15 months ago)
- Location:
- wp-database-backup/tags/7.4/includes
- Files:
-
- 4 edited
-
admin/class-wpdb-admin.php (modified) (2 diffs)
-
admin/cron-create-full-backup-incremental.php (modified) (1 diff)
-
admin/cron-create-full-backup.php (modified) (1 diff)
-
features.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
wp-database-backup/tags/7.4/includes/admin/class-wpdb-admin.php
r3209256 r3209338 191 191 } else { 192 192 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 }203 193 } 204 194 … … 2410 2400 // Added htaccess file 08-05-2015 for prevent directory listing. 2411 2401 // 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>'; 2420 2411 $wp_filesystem->put_contents( $path_info['basedir'] . '/db-backup/.htaccess', $htaccess_content, FS_CHMOD_FILE ); 2421 2412 2422 }2423 2413 // Begin : Generate SQL DUMP and save to file database.sql. 2424 2414 $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 312 312 //Fixed Vulnerability 22-06-2016 for prevent direct download 313 313 //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>"; 321 322 wpdbbkp_write_file_contents($path_info['basedir'] . '/' . WPDB_BACKUPS_DIR . '/.htaccess',$htaccess_content); 322 323 -
wp-database-backup/tags/7.4/includes/admin/cron-create-full-backup.php
r3209256 r3209338 289 289 //added htaccess file 08-05-2015 for prevent directory listing 290 290 //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 296 294 </IfModule> 297 # END Backup Folder Protection"; 295 296 <IfModule !mod_authz_core.c> 297 Deny from all 298 </IfModule>"; 298 299 wpdbbkp_write_file_contents($path_info['basedir'] . '/' . WPDB_BACKUPS_DIR . '/.htaccess',$htaccess_content); 299 300 -
wp-database-backup/tags/7.4/includes/features.php
r3209256 r3209338 359 359 $htaccess_content = " 360 360 # 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 365 364 </IfModule> 365 366 <IfModule !mod_authz_core.c> 367 Deny from all 368 </IfModule> 369 366 370 # END Backup Folder Protection 367 371 ";
Note: See TracChangeset
for help on using the changeset viewer.