http://www.mediawiki.org/wiki/Special:Code/MediaWiki/96699
Revision: 96699
Author: brion
Date: 2011-09-09 22:03:09 +0000 (Fri, 09 Sep 2011)
Log Message:
-----------
Provisional workaround for bug 30825 as it affects things run via $.ajax()
using protocol-relative links built from wgServer etc -- IE 7 gets confused and
denies access for protocol-relative URLs on XMLHTTPRequest, while it's ok
everywhere else.
This is already internally fixed in jQuery 1.6, so won't be needed on 1.18 and
later.
Modified Paths:
--------------
branches/wmf/1.17wmf1/resources/mediawiki/mediawiki.js
Modified: branches/wmf/1.17wmf1/resources/mediawiki/mediawiki.js
===================================================================
--- branches/wmf/1.17wmf1/resources/mediawiki/mediawiki.js 2011-09-09
21:53:29 UTC (rev 96698)
+++ branches/wmf/1.17wmf1/resources/mediawiki/mediawiki.js 2011-09-09
22:03:09 UTC (rev 96699)
@@ -54,6 +54,22 @@
});
/*
+ * Workaround for API hits with protocol-relative URLs on IE 7 and jQuery 1.4
+ */
+(function(jQuery) {
+ var origAjax = jQuery.ajax;
+ jQuery.ajax = function(origSettings) {
+ var settings = jQuery.extend({}, origSettings);
+ if ('url' in settings && settings.url.substring(0, 2) == '//'
&& typeof window.location == "object" && 'protocol' in window.location) {
+ // IE 7's XMLHTTPRequest gets confused by
protocol-relative links.
+ // Resolve it for the poor dears!
+ settings.url = window.location.protocol + settings.url;
+ }
+ return origAjax(settings);
+ };
+})(jQuery);
+
+/*
* Core MediaWiki JavaScript Library
*/
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs