We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3fa8152 commit 5e17388Copy full SHA for 5e17388
1 file changed
wp-includes/sqlite/class-wp-sqlite-db.php
@@ -314,11 +314,15 @@ public function db_connect( $allow_bail = true ) {
314
$old_db_path = FQDBDIR . '.ht.sqlite';
315
316
if ( file_exists( $old_db_path ) ) {
317
- rename( $old_db_path, FQDB );
+ if ( ! rename( $old_db_path, FQDB ) ) {
318
+ wp_die( 'Failed to rename database file.', 'Error!' );
319
+ }
320
321
foreach ( array( '-wal', '-shm' ) as $suffix ) {
322
if ( file_exists( $old_db_path . $suffix ) ) {
- rename( $old_db_path . $suffix, FQDB . $suffix );
323
+ if ( ! rename( $old_db_path . $suffix, FQDB . $suffix ) ) {
324
325
326
}
327
328
0 commit comments