From 9502fbb44d3de95e8035bba9a63ebe1bcd8b1c55 Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Sun, 1 May 2011 21:14:32 +0000 Subject: [PATCH] (bug 28343) Kill unused contextlines/contextchars --- RELEASE-NOTES | 1 + includes/DefaultSettings.php | 2 -- includes/Preferences.php | 12 ------------ includes/search/SearchEngine.php | 7 ++----- languages/messages/MessagesEn.php | 2 -- maintenance/language/messages.inc | 2 -- 6 files changed, 3 insertions(+), 23 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index d990038ebc..17aabb6fe0 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -71,6 +71,7 @@ PHP if you have not done so prior to upgrading MediaWiki. details. * $wgProfiling has been removed. * The spyc library is now no longer included in phase3. +* (bug 28343) Unused preferences contextlines/contextchars have been removed === New features in 1.18 === * (bug 8130) Query pages should limit to content namespaces, not just main diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 4abd2d5655..5a134f4c0e 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -3063,8 +3063,6 @@ $wgReservedUsernames = array( $wgDefaultUserOptions = array( 'ccmeonemails' => 0, 'cols' => 80, - 'contextchars' => 50, - 'contextlines' => 5, 'date' => 'default', 'diffonly' => 0, 'disablemail' => 0, diff --git a/includes/Preferences.php b/includes/Preferences.php index 65ff625d35..1331181532 100644 --- a/includes/Preferences.php +++ b/includes/Preferences.php @@ -930,18 +930,6 @@ class Preferences { 'section' => 'searchoptions/displaysearchoptions', 'min' => 0, ); - $defaultPreferences['contextlines'] = array( - 'type' => 'int', - 'label-message' => 'contextlines', - 'section' => 'searchoptions/displaysearchoptions', - 'min' => 0, - ); - $defaultPreferences['contextchars'] = array( - 'type' => 'int', - 'label-message' => 'contextchars', - 'section' => 'searchoptions/displaysearchoptions', - 'min' => 0, - ); global $wgEnableMWSuggest; if ( $wgEnableMWSuggest ) { diff --git a/includes/search/SearchEngine.php b/includes/search/SearchEngine.php index f5eaf18b47..a4b3e7136b 100644 --- a/includes/search/SearchEngine.php +++ b/includes/search/SearchEngine.php @@ -362,14 +362,11 @@ class SearchEngine { } /** - * Find snippet highlight settings for a given user + * Find snippet highlight settings for all users * - * @param $user User * @return Array contextlines, contextchars */ - public static function userHighlightPrefs( &$user ) { - // $contextlines = $user->getOption( 'contextlines', 5 ); - // $contextchars = $user->getOption( 'contextchars', 50 ); + public static function userHighlightPrefs() { $contextlines = 2; // Hardcode this. Old defaults sucked. :) $contextchars = 75; // same as above.... :P return array( $contextlines, $contextchars ); diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 3bce962f0a..50ab0eac38 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -1777,8 +1777,6 @@ Note that their indexes of {{SITENAME}} content may be out of date.', 'columns' => 'Columns:', 'searchresultshead' => 'Search', 'resultsperpage' => 'Hits per page:', -'contextlines' => 'Lines per hit:', -'contextchars' => 'Context per line:', 'stub-threshold' => 'Threshold for stub link formatting (bytes):', 'stub-threshold-disabled' => 'Disabled', 'recentchangesdays' => 'Days to show in recent changes:', diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index dcc31b542c..1695d10b35 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -942,8 +942,6 @@ $wgMessageStructure = array( 'columns', 'searchresultshead', 'resultsperpage', - 'contextlines', - 'contextchars', 'stub-threshold', 'stub-threshold-disabled', 'recentchangesdays', -- 2.20.1