mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-28 16:20:52 +00:00
Correctly validate a provider for local api
Make sure that the validation method accounts for local api vs remote api when checking for valid variables. Bug: T90795 Change-Id: Ia6877ca6ccc4e65d1db053f107e7702721e2da3c
This commit is contained in:
parent
bc75cf573f
commit
b85b81c501
|
@ -24,6 +24,7 @@ ve.dm.MWMediaResourceProvider = function VeDmMWMediaResourceProvider( apiurl, co
|
|||
|
||||
// Fetching configuration
|
||||
this.scriptDirUrl = config.scriptDirUrl;
|
||||
this.isLocal = config.local;
|
||||
|
||||
if ( config.local ) {
|
||||
this.setAjaxSettings( {
|
||||
|
@ -291,8 +292,10 @@ ve.dm.MWMediaResourceProvider.prototype.isValid = function () {
|
|||
var params = this.getUserParams();
|
||||
return params.gsrsearch &&
|
||||
(
|
||||
this.isLocal ||
|
||||
// If we don't have either 'apiurl' or 'scriptDirUrl'
|
||||
// the source is invalid, and we will skip it
|
||||
this.apiurl !== undefined || this.scriptDirUrl !== undefined
|
||||
this.apiurl !== undefined ||
|
||||
this.scriptDirUrl !== undefined
|
||||
);
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue