From 12e8fede56b074b17aa49fc8fe30acea6fe603f0 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Thu, 10 Nov 2005 07:46:56 +0000 Subject: [PATCH] * (bug 3562) for go search, try Caps-Variants-Broken-At-Non-Whitespace --- RELEASE-NOTES | 1 + includes/SearchEngine.php | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 8961b7c8fe..c98d882182 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -218,6 +218,7 @@ fully support the editing toolbar, but was found to be too confusing. leads to hard-to-manage names. * (bug 2721) Regression: Use European number separators for vi: wikis * Allow parser cache on redirect targets +* (bug 3562) for go search, try Caps-Variants-Broken-At-Non-Whitespace === Caveats === diff --git a/includes/SearchEngine.php b/includes/SearchEngine.php index 021b2a49a5..5423b473cd 100644 --- a/includes/SearchEngine.php +++ b/includes/SearchEngine.php @@ -81,6 +81,18 @@ class SearchEngine { return $title; } + # Now try Word-Caps-Breaking-At-Word-Breaks, for hyphenated names etc + $title = Title::newFromText( preg_replace_callback( + '/\b([\w\x80-\xff]+)\b/', + create_function( '$matches', ' + global $wgContLang; + return $wgContLang->ucfirst($matches[1]); + ' ), + $term ) ); + if ( $title->exists() ) { + return $title; + } + global $wgCapitalLinks, $wgContLang; if( !$wgCapitalLinks ) { // Catch differs-by-first-letter-case-only -- 2.20.1