Merge "Hard deprecate Language::truncate()"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Fri, 13 Jul 2018 17:58:03 +0000 (17:58 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 13 Jul 2018 17:58:03 +0000 (17:58 +0000)
RELEASE-NOTES-1.32
languages/Language.php

index ac68967..25ea4f6 100644 (file)
@@ -229,6 +229,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().
index 8373ffc..9792095 100644 (file)
@@ -3497,6 +3497,7 @@ class Language {
         * @return string
         */
        function truncate( $string, $length, $ellipsis = '...', $adjustLength = true ) {
+               wfDeprecated( __METHOD__, '1.31' );
                return $this->truncateForDatabase( $string, $length, $ellipsis, $adjustLength );
        }