http://www.mediawiki.org/wiki/Special:Code/MediaWiki/88680
Revision: 88680 Author: krinkle Date: 2011-05-23 20:26:21 +0000 (Mon, 23 May 2011) Log Message: ----------- Adapt UW to account for the change in jQuery's behaviour since jQuery 1.5.2. jQuery attempts to interact with the API by passing a callback parameter (to avoid having to parse JSON strings which is likely slower than just calling a callback). Since the API assumes the origin to be an anonymous user if the callback-parameter is passed we have to override this when dealing with the API (since uploading requires the user to be logged in). Setting jsonp:false will do this. See also: http://api.jquery.com/jQuery.ajax/ (scroll to "jsonp" setting and the note about jQuery 1.5) (Follow-up r88607: Upgrade jQuery 1.4.4 to 1.5.2) Modified Paths: -------------- trunk/extensions/UploadWizard/resources/mw.Api.edit.js Modified: trunk/extensions/UploadWizard/resources/mw.Api.edit.js =================================================================== --- trunk/extensions/UploadWizard/resources/mw.Api.edit.js 2011-05-23 20:24:09 UTC (rev 88679) +++ trunk/extensions/UploadWizard/resources/mw.Api.edit.js 2011-05-23 20:26:21 UTC (rev 88680) @@ -80,7 +80,14 @@ } }; - var ajaxOptions = { 'ok': ok, 'err': err }; + var ajaxOptions = { + 'ok': ok, + 'err': err, + // Due to the API assuming we're logged out if we pass the callback-parameter, + // we have to disable jQuery's callback system, and instead parse JSON string, + // by setting 'jsonp' to false. + 'jsonp': false + }; api.get( parameters, ajaxOptions ); }, _______________________________________________ MediaWiki-CVS mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
