Catrope has uploaded a new change for review.
https://gerrit.wikimedia.org/r/249924
Change subject: Follow-up 65cc2f6c1d:
......................................................................
Follow-up 65cc2f6c1d:
* Don't strip <script> and <style> tags, only <link>
* Also call processCaptchaError in saveReply
Change-Id: Ib28f46d405080eaa05a046dfc3ccf2a46eb454cb
Bonus: Add @private to get() and postEdit()
---
M modules/flow/dm/api/mw.flow.dm.APIHandler.js
1 file changed, 9 insertions(+), 5 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow
refs/changes/24/249924/1
diff --git a/modules/flow/dm/api/mw.flow.dm.APIHandler.js
b/modules/flow/dm/api/mw.flow.dm.APIHandler.js
index 1080edb..26ade8c 100644
--- a/modules/flow/dm/api/mw.flow.dm.APIHandler.js
+++ b/modules/flow/dm/api/mw.flow.dm.APIHandler.js
@@ -44,7 +44,9 @@
};
/**
- * General get request
+ * General get request.
+ *
+ * @private
* @param {string} submodule The requested submodule
* @param {Object} requestParams API request parameters
* @return {jQuery.Promise} Promise that is resolved when the API
request
@@ -63,8 +65,9 @@
};
/**
- * Post with edit token request
+ * Post with edit token request.
*
+ * @private
* @param {string} submodule The requested submodule
* @param {Object} requestParams API request parameters
* @return {jQuery.Promise} Promise that is resolved when the API
request
@@ -183,7 +186,8 @@
return ( new mw.Api() ).postWithToken( 'edit', params )
.then( function ( data ) {
return data.flow.reply.workflow;
- } );
+ } )
+ .then( null, this.processCaptchaError.bind( this ) );
};
/**
@@ -409,8 +413,8 @@
*/
mw.flow.dm.APIHandler.prototype.processCaptchaError = function (
errorCode, errorObj ) {
if ( /spamfilter$/.test( errorCode ) &&
errorObj.error.spamfilter === 'flow-spam-confirmedit-form' ) {
- // // Remove the <link rel="stylesheet" ...> and
<script> and <style> tags
- errorObj.error.$info = $( $.parseHTML(
errorObj.error.info ) ).not( 'link, script, style' );
+ // Remove the <link rel="stylesheet" ...> tag
+ errorObj.error.$info = $( $.parseHTML(
errorObj.error.info ) ).not( 'link' );
}
return $.Deferred().reject( errorCode, errorObj );
--
To view, visit https://gerrit.wikimedia.org/r/249924
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib28f46d405080eaa05a046dfc3ccf2a46eb454cb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Catrope <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits