From: MatmaRex Date: Wed, 14 Nov 2012 20:25:43 +0000 (+0100) Subject: (bug 42097) $.tablesorter fix when wgDefaultDateFormat is unrecognized X-Git-Tag: 1.31.0-rc.0~21640^2 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22auteur_infos%22%2C%20%22id_auteur=%24id%22%29%20.%20%22?a=commitdiff_plain;h=a158c6317147cc4a50e4236937faec24ba3c74e3;p=lhc%2Fweb%2Fwiklou.git (bug 42097) $.tablesorter fix when wgDefaultDateFormat is unrecognized The 'date' parser assumed all wikis use wgDefaultDateFormat that is either 'mdy' or 'dmy', but this is not the case; for example fi.wikipedia uses 'fi normal'. Therefore the correct value was not set, a string was not changed to an array, and a loop that assumed an array would be present hanged forever. Change-Id: Iba17bc6b44d6a2fff491b7462d7a5457f85d19c5 --- diff --git a/resources/jquery/jquery.tablesorter.js b/resources/jquery/jquery.tablesorter.js index 75dd2f1720..95e9e3d41c 100644 --- a/resources/jquery/jquery.tablesorter.js +++ b/resources/jquery/jquery.tablesorter.js @@ -889,6 +889,10 @@ s = [ match[3], match[1], match[2] ]; } else if ( mw.config.get( 'wgDefaultDateFormat' ) === 'dmy' ) { s = [ match[3], match[2], match[1] ]; + } else { + // If we get here, we don't know which order the dd-dd-dddd + // date is in. So return something not entirely invalid. + return '99999999'; } } else if ( ( match = s.match( ts.dateRegex[1] ) ) !== null ) { s = [ match[3], '' + ts.monthNames[match[2]], match[1] ];