aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/functions.php')
-rw-r--r--phpBB/includes/functions.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index af07938879..83cadf426d 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -4781,18 +4781,21 @@ function remote_jquery_url($host)
switch($host)
{
case 'google':
- // Google uses a 1.5.0, 1.5.1 format (it is always a three numbered version)
- return '//ajax.googleapis.com/ajax/libs/jquery/' . ((strlen(JQUERY_VERSION) == 3) ? JQUERY_VERSION . '.0' : JQUERY_VERSION) . '/jquery.min.js';
+ // Google uses a 1.5.0, 1.5.1 format (it adds 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
- return 'http://ajax.aspnetcdn.com/ajax/jQuery/jquery-' . JQUERY_VERSION . '.min.js';
+ $url = 'http://ajax.aspnetcdn.com/ajax/jQuery/jquery-' . JQUERY_VERSION . '.min.js';
break;
case 'jquery':
// jQuery uses a 1.5, 1.5.1 format
- return 'http://code.jquery.com/jquery-' . JQUERY_VERSION . '.min.js';
+ $url = 'http://code.jquery.com/jquery-' . JQUERY_VERSION . '.min.js';
break;
}
+ return $url;
}