* Skin::doEditSectionLink requires type Language for the parameter $lang.
The parameters $tooltip and $lang are mandatory. Omitting the parameters is
deprecated since 1.32.
+* Language::truncate(), deprecated in 1.31, has been removed.
* …
=== Deprecations in 1.33 ===
case self::AS_CANNOT_USE_CUSTOM_MODEL:
case self::AS_PARSE_ERROR:
case self::AS_UNICODE_NOT_SUPPORTED:
- $out->addWikiTextAsInterface(
- '<div class="error">' . "\n" .
- $status->getWikiText() .
- '</div>'
- );
+ $out->wrapWikiTextAsInterface( 'error', $status->getWikiText() );
return true;
case self::AS_SUCCESS_NEW_ARTICLE:
$this->contentFormat,
$ex->getMessage()
);
- $out->addWikiTextAsInterface( '<div class="error">' . $msg->plain() . '</div>' );
+ $out->wrapWikiTextAsInterface( 'error', $msg->plain() );
}
}
$this->contentFormat,
$ex->getMessage()
);
- $out->addWikiTextAsInterface( '<div class="error">' . $msg->plain() . '</div>' );
+ $out->wrapWikiTextAsInterface( 'error', $msg->plain() );
}
}
}
if ( !$status->isGood() ) {
$wgOut->addHTML( '<h2>' . $this->prepareMessage( 'filedeleteerror-short' ) . "</h2>\n" );
- $wgOut->addWikiTextAsInterface( '<div class="error">' .
+ $wgOut->wrapWikiTextAsInterface(
+ 'error',
$status->getWikiText( 'filedeleteerror-short', 'filedeleteerror-long' )
- . '</div>' );
+ );
}
if ( $status->isOK() ) {
$wgOut->setPageTitle( wfMessage( 'actioncomplete' ) );
[ 'image_comment_temp' => [ 'LEFT JOIN', [ 'imgcomment_name = img_name' ] ] ]
);
foreach ( $res as $row ) {
- $commentStore->insert( $dbw, 'img_description', $row->img_description );
+ $imgFields = $commentStore->insert( $dbw, 'img_description', $row->img_description );
+ $dbw->update(
+ 'image',
+ $imgFields,
+ [ 'img_name' => $row->img_name ],
+ __METHOD__
+ );
}
}
[ 'image_comment_temp' => [ 'LEFT JOIN', [ 'imgcomment_name = img_name' ] ] ]
);
foreach ( $res as $row ) {
- $commentStore->insert( $dbw, 'img_description', $row->img_description );
+ $imgFields = $commentStore->insert( $dbw, 'img_description', $row->img_description );
+ $dbw->update(
+ 'image',
+ $imgFields,
+ [ 'img_name' => $row->img_name ],
+ __METHOD__
+ );
}
}
public function execute() {
$text = $this->getFileContents();
$text = InstallDocFormatter::format( $text );
- $this->parent->output->addWikiTextInterface( $text );
+ $this->parent->output->addWikiTextAsInterface( $text );
$this->startForm();
$this->endForm( false );
}
/**
* @param string $text
- * @deprecated since 1.32; use addWikiTextInterface instead
+ * @deprecated since 1.32; use addWikiTextAsInterface instead
*/
public function addWikiText( $text ) {
wfDeprecated( __METHOD__, '1.32' );
- $this->addWikiTextInterface( $text );
+ $this->addWikiTextAsInterface( $text );
}
/**
* @param string $text
+ * @since 1.32
*/
- public function addWikiTextInterface( $text ) {
+ public function addWikiTextAsInterface( $text ) {
$this->addHTML( $this->parent->parse( $text ) );
}
return 'continue';
}
}
- $this->parent->output->addWikiTextInterface( wfMessage( 'config-welcome' )->plain() );
+ $this->parent->output->addWikiTextAsInterface( wfMessage( 'config-welcome' )->plain() );
$status = $this->parent->doEnvironmentChecks();
if ( $status->isGood() ) {
$this->parent->output->addHTML( '<span class="success-message">' .
wfMessage( 'config-env-good' )->escaped() . '</span>' );
- $this->parent->output->addWikiTextInterface( wfMessage( 'config-copyright',
+ $this->parent->output->addWikiTextAsInterface( wfMessage( 'config-copyright',
SpecialVersion::getCopyrightAndAuthorList() )->plain() );
$this->startForm();
$this->endForm();
$outputPage->setRobotPolicy( 'noindex,nofollow' );
$errortext = $error->getWikiText( false, 'view-pool-error' );
- $outputPage->addWikiTextAsInterface( Html::errorBox( $errortext ) );
+ $outputPage->wrapWikiTextAsInterface( 'errorbox', $errortext );
}
# Connection or timeout error
return;
$pOutput = ( $outputDone instanceof ParserOutput )
// phpcs:ignore MediaWiki.Usage.NestedInlineTernary.UnparenthesizedTernary -- FIXME T203805
? $outputDone // object fetched by hook
- : $this->mParserOutput ?: null; // ParserOutput or null, avoid false
+ : ( $this->mParserOutput ?: null ); // ParserOutput or null, avoid false
# Adjust title for main page & pages with displaytitle
if ( $pOutput ) {
);
if ( $error == '' ) {
- $outputPage->addWikiTextAsInterface(
- "<div class=\"error mw-error-cannotdelete\">\n" . $status->getWikiText() . "\n</div>"
+ $outputPage->wrapWikiTextAsInterface(
+ 'error mw-error-cannotdelete',
+ $status->getWikiText()
);
$deleteLogPage = new LogPage( 'delete' );
$outputPage->addHTML( Xml::element( 'h2', null, $deleteLogPage->getName()->text() ) );
// to the filename, because it can get copied with it.
// See T27277.
// phpcs:disable Generic.Files.LineLength
- $out->addWikiTextAsInterface( <<<EOT
-<div class="fullMedia"><span class="dangerousLink">{$medialink}</span> $dirmark<span class="fileInfo">$longDesc</span></div>
-<div class="mediaWarning">$warning</div>
+ $out->wrapWikiTextAsInterface( 'fullMedia', <<<EOT
+<span class="dangerousLink">{$medialink}</span> $dirmark<span class="fileInfo">$longDesc</span>
EOT
);
// phpcs:enable
+ $out->wrapWikiTextAsInterface( 'mediaWarning', $warning );
} else {
- $out->addWikiTextAsInterface( <<<EOT
-<div class="fullMedia">{$medialink} {$dirmark}<span class="fileInfo">$longDesc</span>
-</div>
+ $out->wrapWikiTextAsInterface( 'fullMedia', <<<EOT
+{$medialink} {$dirmark}<span class="fileInfo">$longDesc</span>
EOT
);
}
'file-no-thumb-animation'
)->plain();
- $out->addWikiTextAsInterface( <<<EOT
-<div class="mw-noanimatethumb">{$noAnimMesg}</div>
-EOT
- );
+ $out->wrapWikiTextAsInterface( 'mw-noanimatethumb', $noAnimMesg );
}
if ( !$this->displayImg->isLocal() ) {
*/
protected function failure( $status ) {
$this->getOutput()->setPageTitle( $this->msg( 'actionfailed' ) );
- $this->getOutput()->addWikiTextAsInterface(
- Html::errorBox( $status->getWikiText( 'tags-edit-failure' ) )
+ $this->getOutput()->wrapWikiTextAsInterface(
+ 'errorbox', $status->getWikiText( 'tags-edit-failure' )
);
$this->showForm();
}
$out = $this->getOutput();
if ( !$source->isGood() ) {
- $out->addWikiTextAsInterface( "<div class=\"error\">\n" .
- $this->msg( 'importfailed', $source->getWikiText() )->parse() . "\n</div>" );
+ $out->wrapWikiTextAsInterface( 'error',
+ $this->msg( 'importfailed', $source->getWikiText() )->plain()
+ );
} else {
$importer = new WikiImporter( $source->value, $this->getConfig() );
if ( !is_null( $this->namespace ) ) {
protected function failure( $status ) {
// Messages: revdelete-failure, logdelete-failure
$this->getOutput()->setPageTitle( $this->msg( 'actionfailed' ) );
- $this->getOutput()->addWikiTextAsInterface(
- Html::errorBox(
- $status->getWikiText( $this->typeLabels['failure'] )
- )
+ $this->getOutput()->wrapWikiTextAsInterface(
+ 'errorbox',
+ $status->getWikiText( $this->typeLabels['failure'] )
);
$this->showForm();
}
$out->wrapWikiMsg(
"<h2 class=\"mw-specialpages-note-top\">$1</h2>", 'specialpages-note-top'
);
- $out->addWikiTextAsInterface(
- "<div class=\"mw-specialpages-notes\">\n" .
- implode( "\n", $notes ) .
- "\n</div>"
+ $out->wrapWikiTextAsInterface(
+ 'mw-specialpages-notes',
+ implode( "\n", $notes )
);
}
}
$out->addBacklinkSubtitle( $this->getPageTitle() );
return true;
} else {
- $out->addWikiTextAsInterface( "<div class=\"error\">\n" . $status->getWikiText() .
- "\n</div>" );
+ $out->wrapWikiTextAsInterface( 'error', $status->getWikiText() );
return false;
}
}
// is the tag actually able to be deleted?
$canDeleteResult = ChangeTags::canDeleteTag( $tag, $user );
if ( !$canDeleteResult->isGood() ) {
- $out->addWikiTextAsInterface( "<div class=\"error\">\n" . $canDeleteResult->getWikiText() .
- "\n</div>" );
+ $out->wrapWikiTextAsInterface( 'error', $canDeleteResult->getWikiText() );
if ( !$canDeleteResult->isOK() ) {
return;
}
$func = $activate ? 'canActivateTag' : 'canDeactivateTag';
$result = ChangeTags::$func( $tag, $user );
if ( !$result->isGood() ) {
- $out->addWikiTextAsInterface( "<div class=\"error\">\n" . $result->getWikiText() .
- "\n</div>" );
+ $out->wrapWikiTextAsInterface( 'error', $result->getWikiText() );
if ( !$result->isOK() ) {
return;
}
$out->addReturnTo( $this->getPageTitle() );
return true;
} else {
- $out->addWikiTextAsInterface( "<div class=\"error\">\n" . $status->getWikitext() .
- "\n</div>" );
+ $out->wrapWikiTextAsInterface( 'error', $status->getWikitext() );
return false;
}
}
// Show revision undeletion warnings and errors
$status = $archive->getRevisionStatus();
if ( $status && !$status->isGood() ) {
- $out->addWikiTextAsInterface( '<div class="error" id="mw-error-cannotundelete">' .
+ $out->wrapWikiTextAsInterface(
+ 'error',
+ '<div id="mw-error-cannotundelete">' .
$status->getWikiText(
'cannotundelete',
'cannotundelete'
// Show file undeletion warnings and errors
$status = $archive->getFileStatus();
if ( $status && !$status->isGood() ) {
- $out->addWikiTextAsInterface( '<div class="error">' .
+ $out->wrapWikiTextAsInterface(
+ 'error',
$status->getWikiText(
'undelete-error-short',
'undelete-error-long'
- ) . '</div>'
+ )
);
}
}
return;
} else {
// Print an error message and redisplay the form
- $out->addWikiTextAsInterface( '<div class="error">' . $status->getWikiText() . '</div>' );
+ $out->wrapWikiTextAsInterface( 'error', $status->getWikiText() );
}
}
}
);
}
- /**
- * 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)
* Belarusian in Taraškievica orthography (Беларуская тарашкевіца)
*
* @ingroup Language
- * @see http://be-x-old.wikipedia.org/wiki/Project_talk:LanguageBe_tarask.php
+ * @see https://be-tarask.wikipedia.org/wiki/Project_talk:LanguageBe_tarask.php
*/
// phpcs:ignore Squiz.Classes.ValidClassName.NotCamelCaps
class LanguageBe_tarask extends Language {