Make WordPress Core

Opened 11 years ago

Closed 10 years ago

#14064 closed defect (bug) (invalid)

In certain situations (migrations, etc.) the admin login page style urls are incorrect

Reported by: mongoose643 Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.9.2
Component: Administration Keywords: reporter-feedback
Focuses: Cc:

Description (last modified by nacin)

I found this bug after launching a wordpress site that was initially set up in a subdirectory on a different domain and then moved to the web root of the primary domain. I don't know for sure that this procedure is what brought out the bug.

On a more technical note, the bug is that the WP_Styles::_css_href() method has an if statement condition that checks the SRC URI for the stylesheet. Unlike other places in the system, this conditional check did not account for root relative URIs by checking to see if the first character was a forward slash "/".

Here is the modified version of this method:

function _css_href( $src, $ver, $handle ) {
    if ( !preg_match('|^https?://|', $src) && substr($src, 0, 1) != '/' && ! ( $this->content_url && 0 === strpos($src, $this->content_url) ) ) {
        $src = $this->base_url . $src;

    $src = add_query_arg('ver', $ver, $src);
    $src = apply_filters( 'style_loader_src', $src, $handle );
    return esc_url( $src );

Change History (2)

#1 @nacin
11 years ago

  • Description modified (diff)

#2 @nacin
10 years ago

  • Keywords reporter-feedback added; login styles url uri broken removed
  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

We need more details of the configuration here. You likely you have your home URL set to '/', which isn't supported. (It should be a FQ URL.)

Closing as invalid. Re-open with more feedback.

Note: See TracTickets for help on using tickets.