* @details
*/
+use MediaWiki\MediaWikiServices;
+
/**
* Base code for file repositories.
*
* @return string
*/
public function getNameFromTitle( Title $title ) {
- global $wgContLang;
if ( $this->initialCapital != MWNamespace::isCapitalized( NS_FILE ) ) {
$name = $title->getUserCaseDBKey();
if ( $this->initialCapital ) {
- $name = $wgContLang->ucfirst( $name );
+ $name = MediaWikiServices::getInstance()->getContentLanguage()->ucfirst( $name );
}
} else {
$name = $title->getDBkey();
if ( $status->successCount == 0 ) {
$status->setOK( false );
}
- if ( isset( $status->value[0] ) ) {
- $status->value = $status->value[0];
- } else {
- $status->value = false;
- }
+ $status->value = $status->value[0] ?? false;
return $status;
}
}
/**
- * Checks existence of a a file
+ * Checks existence of a file
*
* @param string $file Virtual URL (or storage path) of file to check
* @return bool