From 82eab17c1628e392b8dfe4655e25e01799941122 Mon Sep 17 00:00:00 2001 From: Platonides Date: Fri, 28 Jan 2011 22:27:52 +0000 Subject: [PATCH] Update comments to take into account r80443 and r80614 changes, per CR. --- includes/Collation.php | 5 ++++- includes/Title.php | 7 ++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/includes/Collation.php b/includes/Collation.php index d579d58fa0..f00b568f60 100644 --- a/includes/Collation.php +++ b/includes/Collation.php @@ -26,7 +26,7 @@ abstract class Collation { * Given a string, convert it to a (hopefully short) key that can be used * for efficient sorting. A binary sort according to the sortkeys * corresponds to a logical sort of the corresponding strings. Current - * code expects that a null character should sort before all others, but + * code expects that a line feed character should sort before all others, but * has no other particular expectations (and that one can be changed if * necessary). * @@ -130,6 +130,9 @@ class IcuCollation extends Collation { } function getSortKey( $string ) { + // intl extension produces non null-terminated + // strings. Appending '' fixes it so that it doesn't generate + // a warning on each access in debug php. wfSuppressWarnings(); $key = $this->mainCollator->getSortKey( $string ) . ''; wfRestoreWarnings(); diff --git a/includes/Title.php b/includes/Title.php index f67218df3d..102ce27c9c 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -4152,9 +4152,10 @@ class Title { public function getCategorySortkey( $prefix = '' ) { $unprefixed = $this->getText(); if ( $prefix !== '' ) { - # Separate with a null byte, so the unprefixed part is only used as - # a tiebreaker when two pages have the exact same prefix -- null - # sorts before everything else (hopefully). + # Separate with a line feed, so the unprefixed part is only used as + # a tiebreaker when two pages have the exact same prefix. + # In UCA, tab is the only character that can sort above LF + # so we strip both of them from the original prefix. $prefix = strtr( $prefix, "\n\t", ' ' ); return "$prefix\n$unprefixed"; } -- 2.20.1