mw.util.getParamValue( "foo", "http://mw.org/#&foo=bad" ) returns 'bad' istead of null.
Anchoring the regular expression at the beginning of the string should solve this.
Version: 1.18.x
Severity: normal
Schnark | |
Feb 15 2011, 8:34 AM |
F7223: core.diff | |
Nov 21 2014, 11:18 PM |
mw.util.getParamValue( "foo", "http://mw.org/#&foo=bad" ) returns 'bad' istead of null.
Anchoring the regular expression at the beginning of the string should solve this.
Version: 1.18.x
Severity: normal
Created attachment 8847
Proposed patch
The patch also includes a qunit test to confirm the correct behavior.
Attached:
Thanks a lot for this. The patch looks good!
I'll apply locally in a few minutes, test it to be sure and commit.
We can probably get this backported to the 1.18 branch as well since it's a bugfix.
Leaving status "NEW" for now, as it's not fixed yet.