From 55277642f8d56e7f6e47824774bdab14a95ac4fe Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Thu, 28 Jun 2007 16:06:10 +0000 Subject: [PATCH] * Use native XMLHttpRequest class in preference to ActiveX on IE 7; this avoids the "ActiveX "Do you want to allow ActiveX?" prompt when something security settings are cranked this way and AJAX-y gets used. We still get prompts on IE 6, though, which is kind of annoying. --- RELEASE-NOTES | 3 +++ includes/DefaultSettings.php | 2 +- skins/common/ajax.js | 17 +++++++++++------ 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 316af87b89..61bc085af6 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -226,6 +226,9 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 10397) Fix AJAX watch error fallback when we receive a bogus result * (bug 10396) Fix AJAX error when $wgScriptPath/index.php is not valid; using $wgScript now included in JS info +* Use native XMLHttpRequest class in preference to ActiveX on IE 7; this + avoids the "ActiveX "Do you want to allow ActiveX?" prompt when something + security settings are cranked this way and AJAX-y gets used. == API changes since 1.10 == diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 4579cac2ed..d05cb5a634 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -1198,7 +1198,7 @@ $wgCacheEpoch = '20030516000000'; * to ensure that client-side caches don't keep obsolete copies of global * styles. */ -$wgStyleVersion = '78'; +$wgStyleVersion = '79'; # Server-side caching: diff --git a/skins/common/ajax.js b/skins/common/ajax.js index 87fe834902..c84f3370b3 100644 --- a/skins/common/ajax.js +++ b/skins/common/ajax.js @@ -39,16 +39,21 @@ function sajax_init_object() { sajax_debug("sajax_init_object() called..") var A; try { - A=new ActiveXObject("Msxml2.XMLHTTP"); + // Try the new style before ActiveX so we don't + // unnecessarily trigger warnings in IE 7 when + // set to prompt about ActiveX usage + A = new XMLHttpRequest(); } catch (e) { try { - A=new ActiveXObject("Microsoft.XMLHTTP"); - } catch (oc) { - A=null; + A=new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + A=new ActiveXObject("Microsoft.XMLHTTP"); + } catch (oc) { + A=null; + } } } - if(!A && typeof XMLHttpRequest != "undefined") - A = new XMLHttpRequest(); if (!A) sajax_debug("Could not create connection object."); -- 2.20.1