Remove useless test in getParamValue function of mediawiki.util.js
authorvlakoff <vlakoff@gmail.com>
Sat, 9 Jun 2012 10:08:40 +0000 (12:08 +0200)
committervlakoff <vlakoff@gmail.com>
Sat, 9 Jun 2012 10:16:34 +0000 (12:16 +0200)
Regarding that regexp, when it matches, the result ("m" variable)
is forcibly an array of length 2, m[1] being a defined string
(which may be an empty string).

Change-Id: If40c4bc209719f0f54742d6e3eb6a11b99b57370

resources/mediawiki/mediawiki.util.js

index 4c20fad..9202d2e 100644 (file)
                        // Get last match, stop at hash
                        var     re = new RegExp( '^[^#]*[&?]' + $.escapeRE( param ) + '=([^&#]*)' ),
                                m = re.exec( url );
-                       if ( m && m.length > 1 ) {
+                       if ( m ) {
                                // Beware that decodeURIComponent is not required to understand '+'
                                // by spec, as encodeURIComponent does not produce it.
                                return decodeURIComponent( m[1].replace( /\+/g, '%20' ) );