* The permissions for the base directory must allow for writing files in order
* for the wp-config.php to be created using this page.
*
- * @internal This file must be parsable by PHP4.
- *
* @package WordPress
* @subpackage Administration
*/
*/
error_reporting(0);
-define( 'ABSPATH', dirname( dirname( __FILE__ ) ) . '/' );
+if ( ! defined( 'ABSPATH' ) ) {
+ define( 'ABSPATH', dirname( dirname( __FILE__ ) ) . '/' );
+}
require( ABSPATH . 'wp-settings.php' );
<?php wp_admin_css( 'install', true ); ?>
</head>
<body class="<?php echo implode( ' ', $body_classes ); ?>">
-<p id="logo"><a href="<?php esc_attr_e( 'https://wordpress.org/' ); ?>" tabindex="-1"><?php _e( 'WordPress' ); ?></a></p>
+<p id="logo"><a href="<?php echo esc_url( __( 'https://wordpress.org/' ) ); ?>" tabindex="-1"><?php _e( 'WordPress' ); ?></a></p>
<?php
} // end function setup_config_display_header();
if ( ! empty( $wpdb->error ) )
wp_die( $wpdb->error->get_error_message() . $tryagain_link );
+ $wpdb->query( "SELECT $prefix" );
+ if ( ! $wpdb->last_error ) {
+ // MySQL was able to parse the prefix as a value, which we don't want. Bail.
+ wp_die( __( '<strong>ERROR</strong>: "Table Prefix" is invalid.' ) );
+ }
+
// Generate keys and salts using secure CSPRNG; fallback to API if enabled; further fallback to original wp_generate_password().
try {
$chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_ []{}<>~`+=,.;:/?|';
}
$key = 0;
- // Not a PHP5-style by-reference foreach, as this file must be parseable by PHP4.
foreach ( $config_file as $line_num => $line ) {
if ( '$table_prefix =' == substr( $line, 0, 16 ) ) {
$config_file[ $line_num ] = '$table_prefix = \'' . addcslashes( $prefix, "\\'" ) . "';\r\n";