* ApiPageSet::setRedirectMergePolicy() was added. This allows generator
modules to define how generator data for a redirect source gets merged
into the redirect destination.
+* prop=imageinfo&iiprop=uploadwarning will no longer include the possibility of
+ "was-deleted" warning.
=== Action API internal changes in 1.27 ===
}
# Give a notice if the user is uploading a file that has been deleted or moved
- # Note that this is independent from the message 'filewasdeleted' that requires JS
+ # Note that this is independent from the message 'filewasdeleted'
$desiredTitleObj = Title::makeTitleSafe( NS_FILE, $this->mDesiredDestName );
$delNotice = ''; // empty by default
if ( $desiredTitleObj instanceof Title && !$desiredTitleObj->exists() ) {
}
if ( $warning == 'exists' ) {
$msg = "\t<li>" . self::getExistsWarning( $args ) . "</li>\n";
+ } elseif ( $warning == 'was-deleted' ) {
+ # If the file existed before and was deleted, warn the user of this
+ $ltitle = SpecialPage::getTitleFor( 'Log' );
+ $llink = Linker::linkKnown(
+ $ltitle,
+ wfMessage( 'deletionlog' )->escaped(),
+ array(),
+ array(
+ 'type' => 'delete',
+ 'page' => Title::makeTitle( NS_FILE, $args )->getPrefixedText(),
+ )
+ );
+ $msg = "\t<li>" . wfMessage( 'filewasdeleted' )->rawParams( $llink )->parse() . "</li>\n";
} elseif ( $warning == 'duplicate' ) {
$msg = $this->getDupeWarning( $args );
} elseif ( $warning == 'duplicate-archive' ) {
$warning = wfMessage( 'file-thumbnail-no', $badPart )->parse();
} elseif ( $exists['warning'] == 'bad-prefix' ) {
$warning = wfMessage( 'filename-bad-prefix', $exists['prefix'] )->parse();
- } elseif ( $exists['warning'] == 'was-deleted' ) {
- # If the file existed before and was deleted, warn the user of this
- $ltitle = SpecialPage::getTitleFor( 'Log' );
- $llink = Linker::linkKnown(
- $ltitle,
- wfMessage( 'deletionlog' )->escaped(),
- array(),
- array(
- 'type' => 'delete',
- 'page' => $filename
- )
- );
- $warning = wfMessage( 'filewasdeleted' )->rawParams( $llink )->parseAsBlock();
}
return $warning;
$warnings['exists'] = $exists;
}
+ if ( $localFile->wasDeleted() && !$localFile->exists() ) {
+ $warnings['was-deleted'] = $filename;
+ }
+
// Check dupes against existing files
$hash = $this->getTempFileSha1Base36();
$dupes = RepoGroup::singleton()->findBySha1( $hash );
return array( 'warning' => 'page-exists', 'file' => $file );
}
- if ( $file->wasDeleted() && !$file->exists() ) {
- return array( 'warning' => 'was-deleted', 'file' => $file );
- }
-
if ( strpos( $file->getName(), '.' ) == false ) {
$partname = $file->getName();
$extension = '';