"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "includes/specials/SpecialPageLanguage.php" between
mediawiki-1.31.1.tar.gz and mediawiki-1.32.0.tar.gz

About: MediaWiki is a wiki engine (the collaborative editing software that runs for e.g. Wikipedia, the free encyclopedia).

SpecialPageLanguage.php  (mediawiki-1.31.1):SpecialPageLanguage.php  (mediawiki-1.32.0)
skipping to change at line 85 skipping to change at line 85
$page['selectoptions'] = [ $page['selectoptions'] = [
'id' => 'mw-pl-options', 'id' => 'mw-pl-options',
'type' => 'radio', 'type' => 'radio',
'options' => $selectoptions, 'options' => $selectoptions,
'default' => $hasCustomLanguageSet ? 2 : 1 'default' => $hasCustomLanguageSet ? 2 : 1
]; ];
// Building a language selector // Building a language selector
$userLang = $this->getLanguage()->getCode(); $userLang = $this->getLanguage()->getCode();
$languages = Language::fetchLanguageNames( $userLang, 'mwfile' ); $languages = Language::fetchLanguageNames( $userLang, 'mwfile' );
ksort( $languages );
$options = []; $options = [];
foreach ( $languages as $code => $name ) { foreach ( $languages as $code => $name ) {
$options["$code - $name"] = $code; $options["$code - $name"] = $code;
} }
$page['language'] = [ $page['language'] = [
'id' => 'mw-pl-languageselector', 'id' => 'mw-pl-languageselector',
'cssclass' => 'mw-languageselector', 'cssclass' => 'mw-languageselector',
'type' => 'select', 'type' => 'select',
'options' => $options, 'options' => $options,
skipping to change at line 167 skipping to change at line 166
// Url to redirect to after the operation // Url to redirect to after the operation
$this->goToUrl = $title->getFullUrlForRedirect( $this->goToUrl = $title->getFullUrlForRedirect(
$title->isRedirect() ? [ 'redirect' => 'no' ] : [] $title->isRedirect() ? [ 'redirect' => 'no' ] : []
); );
return self::changePageLanguage( return self::changePageLanguage(
$this->getContext(), $this->getContext(),
$title, $title,
$newLanguage, $newLanguage,
$data['reason'] === null ? '' : $data['reason'] $data['reason'] ?? ''
); );
} }
/** /**
* @param IContextSource $context * @param IContextSource $context
* @param Title $title * @param Title $title
* @param string $newLanguage Language code * @param string $newLanguage Language code
* @param string $reason Reason for the change * @param string $reason Reason for the change
* @param array $tags Change tags to apply to the log entry * @param array $tags Change tags to apply to the log entry
* @return Status * @return Status
skipping to change at line 228 skipping to change at line 227
) ); ) );
} }
return Status::newFatal( return Status::newFatal(
'pagelang-unchanged-language', 'pagelang-unchanged-language',
wfEscapeWikiText( $title->getPrefixedText() ), wfEscapeWikiText( $title->getPrefixedText() ),
$oldLanguage $oldLanguage
); );
} }
// Hardcoded [def] if the language is set to null // Hardcoded [def] if the language is set to null
$logOld = $oldLanguage ? $oldLanguage : $defLang . '[def]'; $logOld = $oldLanguage ?: $defLang . '[def]';
$logNew = $newLanguage ? $newLanguage : $defLang . '[def]'; $logNew = $newLanguage ?: $defLang . '[def]';
// Writing new page language to database // Writing new page language to database
$dbw->update( $dbw->update(
'page', 'page',
[ 'page_lang' => $newLanguage ], [ 'page_lang' => $newLanguage ],
[ [
'page_id' => $pageId, 'page_id' => $pageId,
'page_lang' => $oldLanguage 'page_lang' => $oldLanguage
], ],
__METHOD__ __METHOD__
 End of changes. 3 change blocks. 
4 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)