From: C. Scott Ananian Date: Wed, 13 Jun 2018 17:49:29 +0000 (-0400) Subject: Hard deprecate Language::truncate() X-Git-Tag: 1.34.0-rc.0~4783^2 X-Git-Url: http://git.cyclocoop.org/?a=commitdiff_plain;h=b93394bd15dec440d4c7159b58ed1af62be51c3a;p=lhc%2Fweb%2Fwiklou.git Hard deprecate Language::truncate() This was split into Language::truncateForVisual() (which measures characters) and Language::truncateForDatabase() (which measures bytes) in 1.31. Bug: T197492 Change-Id: I949eab4ceb8dcb707b45edf7623e496eb99fe33b --- diff --git a/RELEASE-NOTES-1.32 b/RELEASE-NOTES-1.32 index c41e5b5dc8..03dc9afc39 100644 --- a/RELEASE-NOTES-1.32 +++ b/RELEASE-NOTES-1.32 @@ -225,6 +225,12 @@ because of Phabricator reports. it had unexpected behavior (only marking text if it looked like a URL) and was only used in a single place in the code. Use LanguageConverter::markNoConversion() instead. +* (T197492) Language::truncate() was soft deprecated in 1.31 and is + hard deprecated in this release. It has been split into two similar + methods, Language::truncateForVisual() and Language::truncateForDatabase(), + which measure length in characters and bytes, respectively. Use + Language::truncateForVisual() when possible to provide equity to users + of multibyte scripts. * (T176526) EditPage::getContextTitle() falling back to $wgTitle when the context title is unset is now deprecated; anything creating an EditPage instance should set the context title via ::setContextTitle(). diff --git a/languages/Language.php b/languages/Language.php index 32539574c9..71b3666571 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -3489,6 +3489,7 @@ class Language { * @return string */ function truncate( $string, $length, $ellipsis = '...', $adjustLength = true ) { + wfDeprecated( __METHOD__, '1.31' ); return $this->truncateForDatabase( $string, $length, $ellipsis, $adjustLength ); }