r75260 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r75259‎ | r75260 | r75261 >
Date:16:23, 23 October 2010
Author:nikerabbit
Status:ok
Tags:
Comment:
Fix issues with ampersands and other characters
Modified paths:
  • /trunk/extensions/Translate/js/quickedit.js (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/js/quickedit.js
@@ -47,7 +47,7 @@
4848
4949 function trlOpenJsEdit( page, group ) {
5050 var url = wgScript + "?title=Special:Translate/editpage&suggestions=async&page=$1&loadgroup=$2";
51 - url = url.replace( "$1", page ).replace( "$2", group );
 51+ url = url.replace( "$1", encodeURIComponent( page ) ).replace( "$2", encodeURIComponent( group ) );
5252 var id = "jsedit" + page.replace( /[^a-zA-Z0-9_]/g, '_' );
5353
5454 var dialog = jQuery("#"+id);
@@ -89,7 +89,7 @@
9090 if ( form.find( ".mw-translate-messagechecks" ) ) {
9191 var checker = new MessageCheckUpdater( function() {
9292 var url = wgScript + "?title=Special:Translate/editpage&suggestions=checks&page=$1&loadgroup=$2";
93 - url = url.replace( "$1", page ).replace( "$2", group );
 93+ url = url.replace( "$1", encodeURIComponent( page ) ).replace( "$2", encodeURIComponent( group ) );
9494 jQuery.post( url, { translation: textarea.val() } , function(mydata) {
9595 form.find( ".mw-translate-messagechecks" ).replaceWith( mydata );
9696 });

Status & tagging log