let wp_enqueue_script and wp_enqueue_style use '//' as scheme
|Reported by:||mimecine||Owned by:||nacin|
|Component:||General||Keywords:||has-patch 3.4-early commit|
When loading external resources, most browsers (need to be confirmed) will auto select between https:// and http:// if the url-scheme is simply //. For example, //ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js would load over https if the containing page was https itself, but over http if wasn't.
class.wp-scripts.php and class.wp-styles.php does a regex check for ^https?:// to determine if it is an external resource or not, but should really use ^(https?:)?// - or even ^(\w+:)?// (since some loony *could* use ftp for example).
Change History (25)
- Keywords needs-patch added
- Milestone changed from Awaiting Review to Future Release
comment:12 follow-up: ↓ 13 @azaozz — 4 years ago
- Keywords needs-testing added
- Milestone changed from 3.3 to Future Release
- Type changed from defect (bug) to enhancement
comment:16 follow-up: ↓ 17 @nacin — 4 years ago
- Keywords needs-unit-tests commit added; needs-testing removed