Ensure zxcvbn.min.js loads when we are guessing the wp-includes URL.

props iandunn, SergeyBiryukov.
fixes #25201.

Built from https://develop.svn.wordpress.org/trunk@25246


git-svn-id: http://core.svn.wordpress.org/trunk@25214 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2013-09-04 21:16:09 +00:00
parent 6253183ffc
commit 365a78db7c
1 changed files with 5 additions and 2 deletions

View File

@ -49,8 +49,11 @@ require( ABSPATH . WPINC . '/functions.wp-styles.php' );
*/
function wp_default_scripts( &$scripts ) {
if ( !$guessurl = site_url() )
if ( ! $guessurl = site_url() ) {
$guessed_url = true;
$guessurl = wp_guess_url();
}
$scripts->base_url = $guessurl;
$scripts->content_url = defined('WP_CONTENT_URL')? WP_CONTENT_URL : '';
@ -311,7 +314,7 @@ function wp_default_scripts( &$scripts ) {
$scripts->add( 'zxcvbn-async', "/wp-includes/js/zxcvbn-async$suffix.js", array(), '1.0' );
did_action( 'init' ) && $scripts->localize( 'zxcvbn-async', '_zxcvbnSettings', array(
'src' => includes_url( '/js/zxcvbn.min.js' ),
'src' => empty( $guessed_url ) ? includes_url( '/js/zxcvbn.min.js' ) : $scripts->base_url . '/wp-includes/js/zxcvbn.min.js',
) );
$scripts->add( 'password-strength-meter', "/wp-admin/js/password-strength-meter$suffix.js", array( 'jquery', 'zxcvbn-async' ), false, 1 );