From 365a78db7cdb188ef05fbd555cebb291ce1440f3 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Wed, 4 Sep 2013 21:16:09 +0000 Subject: [PATCH] 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 --- wp-includes/script-loader.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index 3046ef4894..1956ebb665 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -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 );