From c6a2d81bd359711aeb9dc36478977e779d3bdfe9 Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Mon, 26 Sep 2011 11:13:16 -0700 Subject: [PATCH] [ticket/10390] Drop http protocol for Microsoft's CDN option Like Google, Microsoft supports both http and https protocols, so we can drop the protocol alltogether from the url so the Microsoft CDN will work on both HTTP or HTTPS sites without issue. Also I cleaned up some of the comments here. PHPBB3-10390 --- phpBB/includes/functions.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 83cadf426d..8cdafbd95e 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -4773,6 +4773,8 @@ function phpbb_pcre_utf8_support() /** * Build jQuery URL for remote CDNs * Reference: http://docs.jquery.com/Downloading_jQuery#CDN_Hosted_jQuery +* HTTP protocols intentionally omitted for Google and Microsoft - its the best +* way to reference third party content that is available via both HTTP and HTTPS * * @return string Returns url to a jQuery library */ @@ -4781,15 +4783,14 @@ function remote_jquery_url($host) switch($host) { case 'google': - // Google uses a 1.5.0, 1.5.1 format (it adds a .0 to new 1.X releases) + // Google uses a 1.5.0, 1.5.1 format (we need to add a .0 to new 1.X releases) $version = (substr_count(JQUERY_VERSION, '.') == 1) ? JQUERY_VERSION . '.0' : JQUERY_VERSION; - // HTTP protocol intentionally omitted - its the best way to reference third party content that is available via both HTTP and HTTPS $url = '//ajax.googleapis.com/ajax/libs/jquery/' . $version . '/jquery.min.js'; break; case 'microsoft': // Microsoft uses a 1.5, 1.5.1 format - $url = 'http://ajax.aspnetcdn.com/ajax/jQuery/jquery-' . JQUERY_VERSION . '.min.js'; + $url = '//ajax.aspnetcdn.com/ajax/jQuery/jquery-' . JQUERY_VERSION . '.min.js'; break; case 'jquery':