X-Git-Url: https://git.cyclocoop.org/%7B%7B%20url_for%28%27user%27%2C%20userid=session.user.id%29%20%7D%7D?a=blobdiff_plain;f=languages%2FLanguage.php;h=dad9c6c98294b637b817195838ad892b0b92ab54;hb=954b695a850309818c687d904775fe41972d4f36;hp=8104b2c845ea4175a2e5a2cdda007a343838f344;hpb=b3a4973cf89356bedd3255dd40a85588bdbc7f43;p=lhc%2Fweb%2Fwiklou.git diff --git a/languages/Language.php b/languages/Language.php index 8104b2c845..dad9c6c982 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -814,22 +814,6 @@ class Language { return self::$dataCache->getItem( $this->mCode, 'datePreferenceMigrationMap' ); } - /** - * @param string $image - * @return array|null - */ - function getImageFile( $image ) { - return self::$dataCache->getSubitem( $this->mCode, 'imageFiles', $image ); - } - - /** - * @return array - * @since 1.24 - */ - public function getImageFiles() { - return self::$dataCache->getItem( $this->mCode, 'imageFiles' ); - } - /** * @return array */ @@ -3538,28 +3522,6 @@ class Language { ); } - /** - * This method is deprecated since 1.31 and kept as alias for truncateForDatabase, which - * has replaced it. This method provides truncation suitable for DB. - * - * The database offers limited byte lengths for some columns in the database; - * multi-byte character sets mean we need to ensure that only whole characters - * are included, otherwise broken characters can be passed to the user. - * - * @deprecated since 1.31, use truncateForDatabase or truncateForVisual as appropriate. - * - * @param string $string String to truncate - * @param int $length Maximum length (including ellipsis) - * @param string $ellipsis String to append to the truncated text - * @param bool $adjustLength Subtract length of ellipsis from $length. - * $adjustLength was introduced in 1.18, before that behaved as if false. - * @return string - */ - function truncate( $string, $length, $ellipsis = '...', $adjustLength = true ) { - wfDeprecated( __METHOD__, '1.31' ); - return $this->truncateForDatabase( $string, $length, $ellipsis, $adjustLength ); - } - /** * Truncate a string to a specified length in bytes, appending an optional * string (e.g. for ellipsis) @@ -4285,14 +4247,17 @@ class Language { } /** - * Check if the language has the specific variant + * Strict check if the language has the specific variant. + * + * Compare to LanguageConverter::validateVariant() which does a more + * lenient check and attempts to coerce the given code to a valid one. * * @since 1.19 * @param string $variant * @return bool */ public function hasVariant( $variant ) { - return (bool)$this->mConverter->validateVariant( $variant ); + return $variant && ( $variant === $this->mConverter->validateVariant( $variant ) ); } /** @@ -4507,6 +4472,7 @@ class Language { /** * @param string $code + * @deprecated since 1.32, use Language::factory to create a new object instead. */ public function setCode( $code ) { $this->mCode = $code;