[wp-trac] [WordPress Trac] #14064: In certain situations (migrations, etc.) the admin login page style urls are incorrect

WordPress Trac wp-trac at lists.automattic.com
Wed Jun 23 22:13:46 UTC 2010


#14064: In certain situations (migrations, etc.) the admin login page style urls
are incorrect
----------------------------+-----------------------------------------------
 Reporter:  mongoose643     |       Owner:                             
     Type:  defect (bug)    |      Status:  new                        
 Priority:  normal          |   Milestone:  Unassigned                 
Component:  Administration  |     Version:  2.9.2                      
 Severity:  normal          |    Keywords:  login styles url uri broken
----------------------------+-----------------------------------------------
 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 );
 }

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/14064>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list