Make WordPress Core

Opened 15 years ago

Closed 15 years ago

#18336 closed enhancement (duplicate)

Properly detect scheme-less URL's in wp_enqueue_script

Reported by: evansolomon Owned by:
Priority: normal Milestone:
Component: General Version: 3.2.1
Severity: normal Keywords: has-patch
Cc: Focuses:

Description

We should detect script URL's with leading // and load either HTTP or HTTPS depending on the requesting page. This would more accurately reflect the behavior of the src parameter of the default script tag in HTML.

Several third party scripts use this format to load securely only when required.

There's no reason for a relative path to start with // so this should not break any pre-existing use cases.

Attachments (1)

18336.diff (641 bytes ) - added by evansolomon 15 years ago.

Download all attachments as: .zip

Change History (3)

@evansolomon
15 years ago

#1 @koopersmith
15 years ago

  • Milestone Awaiting Review3.3

It sounds like there's no downside to this. wp_enqueue_script should reflect browser behavior, especially since we encourage its use as a best practice.

#2 @SergeyBiryukov
15 years ago

  • Milestone 3.3
  • Resolutionduplicate
  • Status newclosed
Note: See TracTickets for help on using tickets.