diff -r 7b1b88e27a20 -r 48c4eec2b7e6 wp/wp-admin/setup-config.php --- a/wp/wp-admin/setup-config.php Thu Sep 29 08:06:27 2022 +0200 +++ b/wp/wp-admin/setup-config.php Fri Sep 05 18:40:08 2025 +0200 @@ -116,6 +116,10 @@ -

+

+ +

  1. @@ -188,7 +197,7 @@ printf( /* translators: 1: Documentation URL, 2: wp-config.php */ __( 'Need more help? Read the support article on %2$s.' ), - __( 'https://wordpress.org/support/article/editing-wp-config-php/' ), + __( 'https://developer.wordpress.org/advanced-administration/wordpress/wp-config/' ), 'wp-config.php' ); ?> @@ -207,39 +216,52 @@ $autofocus = wp_is_mobile() ? '' : ' autofocus'; ?> -

    +

    + +

    - - + - - + - - + - - +

    - - +

    ' . __( 'Try Again' ) . ''; if ( empty( $prefix ) ) { - wp_die( __( 'Error: "Table Prefix" must not be empty.' ) . $tryagain_link ); + wp_die( __( 'Error: "Table Prefix" must not be empty.' ) . $tryagain_link ); } // Validate $prefix: it can only contain letters, numbers and underscores. if ( preg_match( '|[^a-z0-9_]|i', $prefix ) ) { - wp_die( __( 'Error: "Table Prefix" can only contain numbers, letters, and underscores.' ) . $tryagain_link ); + wp_die( __( 'Error: "Table Prefix" can only contain numbers, letters, and underscores.' ) . $tryagain_link ); } // Test the DB connection. @@ -311,12 +334,13 @@ wp_die( $wpdb->error->get_error_message() . $tryagain_link ); } - $errors = $wpdb->hide_errors(); + $errors = $wpdb->suppress_errors(); $wpdb->query( "SELECT $prefix" ); - $wpdb->show_errors( $errors ); + $wpdb->suppress_errors( $errors ); + if ( ! $wpdb->last_error ) { // MySQL was able to parse the prefix as a value, which we don't want. Bail. - wp_die( __( 'Error: "Table Prefix" is invalid.' ) ); + wp_die( __( 'Error: "Table Prefix" is invalid.' ) ); } // Generate keys and salts using secure CSPRNG; fallback to API if enabled; further fallback to original wp_generate_password(). @@ -352,7 +376,7 @@ $key = 0; foreach ( $config_file as $line_num => $line ) { - if ( '$table_prefix =' === substr( $line, 0, 15 ) ) { + if ( str_starts_with( $line, '$table_prefix =' ) ) { $config_file[ $line_num ] = '$table_prefix = \'' . addcslashes( $prefix, "\\'" ) . "';\r\n"; continue; } @@ -372,7 +396,7 @@ $config_file[ $line_num ] = "define( '" . $constant . "'," . $padding . "'" . addcslashes( constant( $constant ), "\\'" ) . "' );\r\n"; break; case 'DB_CHARSET': - if ( 'utf8mb4' === $wpdb->charset || ( ! $wpdb->charset && $wpdb->has_cap( 'utf8mb4' ) ) ) { + if ( 'utf8mb4' === $wpdb->charset || ( ! $wpdb->charset ) ) { $config_file[ $line_num ] = "define( '" . $constant . "'," . $padding . "'utf8mb4' );\r\n"; } break; @@ -393,13 +417,13 @@ if ( ! is_writable( ABSPATH ) ) : setup_config_display_header(); ?> -

    +

    wp-config.php' ); ?>

    -

    +

    wp-config.php' ); @@ -411,7 +435,13 @@ } ?>

    - +

    +