From a158c6317147cc4a50e4236937faec24ba3c74e3 Mon Sep 17 00:00:00 2001 From: MatmaRex Date: Wed, 14 Nov 2012 21:25:43 +0100 Subject: [PATCH] (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 --- resources/jquery/jquery.tablesorter.js | 4 ++++ 1 file changed, 4 insertions(+) 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] ]; -- 2.20.1