r75553 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r75552‎ | r75553 | r75554 >
Date:15:37, 27 October 2010
Author:krinkle
Status:ok
Tags:
Comment:
Escaping parameter for regex (Follow-up r75275)
Modified paths:
  • /trunk/phase3/resources/mediawiki.util/mediawiki.util.js (modified) (history)

Diff [purge]

Index: trunk/phase3/resources/mediawiki.util/mediawiki.util.js
@@ -114,7 +114,7 @@
115115 */
116116 'getParamValue' : function( param, url ) {
117117 url = url ? url : document.location.href;
118 - var re = new RegExp('[^#]*[&?]' + param + '=([^&#]*)'); // Get last match, stop at hash
 118+ var re = new RegExp('[^#]*[&?]' + param.escapeRE() + '=([^&#]*)'); // Get last match, stop at hash
119119 var m = re.exec(url);
120120 if (m && m.length > 1) {
121121 return decodeURIComponent(m[1]);

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r75275adding begin of mediaWiki.util and loading it by default + trailing whitespac...krinkle17:24, 23 October 2010

Status & tagging log