[wp-trac] [WordPress Trac] #34591: BugFix to WP_Scripts::do_item(), remove doubled "//"

WordPress Trac noreply at wordpress.org
Thu Nov 5 11:01:38 UTC 2015


#34591: BugFix to WP_Scripts::do_item(), remove doubled "//"
---------------------------+-----------------------------
 Reporter:  jan.mazanek    |      Owner:
     Type:  defect (bug)   |     Status:  new
 Priority:  normal         |  Milestone:  Awaiting Review
Component:  Script Loader  |    Version:  4.3.1
 Severity:  normal         |   Keywords:
  Focuses:                 |
---------------------------+-----------------------------
 Current code in do_item() of class.wp-script.php on line 172:

 {{{
 $src = $this->base_url . $src;
 }}}

 may produce duplicate slashes "//", resulting in problems.

 This might be fixed with code:
 {{{
 $src = $this->base_url . $src;
 }}}

 Currently:
 * WP_Scripts contains: "public $base_url; // Full URL with trailing slash"
 and
 * script-loader.php contains calls $scripts->add() with initial "/" in
 relative paths

 Together this produces doubled slashes "//". For example:
 http://www.ocelovehaly.cz/ll//wp-includes/js/jquery/jquery.js?ver=1.11.3

 This makes W3TC include script  in minified version, but not to remove it
 from the original HTML.

 Including jQuery twice makes LayerSlider not to work.

 Please, could you bugfix class.wp-script.php on line 172?

 Thank you :-)

--
Ticket URL: <https://core.trac.wordpress.org/ticket/34591>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list