* (bug 17139) ts_resortTable inconsistent trimming makes date sorting fragile
authorBrion Vibber <brion@users.mediawiki.org>
Sun, 19 Jul 2009 21:25:47 +0000 (21:25 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Sun, 19 Jul 2009 21:25:47 +0000 (21:25 +0000)
Added a trim on the sort key preprocessing as well as the picking of the preprocessor

RELEASE-NOTES
includes/DefaultSettings.php
skins/common/wikibits.js

index ec8564c..5316659 100644 (file)
@@ -297,6 +297,7 @@ this. Was used when mwEmbed was going to be an extension.
 * (bug 19287) Workaround for lag on history page in Firefox 3.5
 * (bug 19564) Updated docs/hooks.txt
 * (bug 18751) Fix for buggage in profiling setup for some extensions on PHP 5.1
+* (bug 17139) ts_resortTable inconsistent trimming makes date sorting fragile
 
 == API changes in 1.16 ==
 
index 99ef085..f92db34 100644 (file)
@@ -1578,7 +1578,7 @@ $wgCacheEpoch = '20030516000000';
  * to ensure that client-side caches do not keep obsolete copies of global
  * styles.
  */
-$wgStyleVersion = '234';
+$wgStyleVersion = '235';
 
 
 # Server-side caching:
index 8b4ab55..75a281a 100644 (file)
@@ -686,7 +686,7 @@ function ts_resortTable(lnk) {
                if((" "+row.className+" ").indexOf(" unsortable ") < 0) {
                        var keyText = ts_getInnerText(row.cells[column]);
                        var oldIndex = (reverse ? -j : j);
-                       var preprocessed = preprocessor( keyText );
+                       var preprocessed = preprocessor( keyText.replace(/^[\s\xa0]+/, "").replace(/[\s\xa0]+$/, "") );
 
                        newRows[newRows.length] = new Array(row, preprocessed, oldIndex);
                } else staticRows[staticRows.length] = new Array(row, false, j-rowStart);