const BEFORE_PROCESSING = 1;
const LARGE_FILE_SERVER = 2;
const EMPTY_FILE = 3;
- const MIN_LENGHT_PARTNAME = 4;
+ const MIN_LENGTH_PARTNAME = 4;
const ILLEGAL_FILENAME = 5;
const PROTECTED_PAGE = 6;
const OVERWRITE_EXISTING_FILE = 7;
$this->mDesiredDestName = $request->getText( 'wpDestFile' );
$this->mIgnoreWarning = $request->getCheck( 'wpIgnoreWarning' );
$this->mComment = $request->getText( 'wpUploadDescription' );
+ $this->mForReUpload = $request->getBool( 'wpForReUpload' );
+ $this->mReUpload = $request->getCheck( 'wpReUpload' );
if( !$request->wasPosted() ) {
# GET requests just give the main form; no data except destination
# Placeholders for text injection by hooks (empty per default)
$this->uploadFormTextTop = "";
$this->uploadFormTextAfterSummary = "";
-
- $this->mReUpload = $request->getCheck( 'wpReUpload' );
$this->mUploadClicked = $request->getCheck( 'wpUpload' );
$this->mLicense = $request->getText( 'wpLicense' );
* Returns true if there was an error, false otherwise
*/
private function curlCopy( $url, $dest ) {
- global $wgUser, $wgOut;
+ global $wgUser, $wgOut, $wgHTTPProxy, $wgCopyUploadTimeout;
if( !$wgUser->isAllowed( 'upload_by_url' ) ) {
$wgOut->permissionRequired( 'upload_by_url' );
$ch = curl_init();
curl_setopt( $ch, CURLOPT_HTTP_VERSION, 1.0); # Probably not needed, but apparently can work around some bug
- curl_setopt( $ch, CURLOPT_TIMEOUT, 10); # 10 seconds timeout
+ curl_setopt( $ch, CURLOPT_TIMEOUT, $wgCopyUploadTimeout); # Default 30 seconds timeout
curl_setopt( $ch, CURLOPT_LOW_SPEED_LIMIT, 512); # 0.5KB per second minimum transfer speed
curl_setopt( $ch, CURLOPT_URL, $url);
+ if( $wgHTTPProxy ) {
+ curl_setopt( $ch, CURLOPT_PROXY, $wgHTTPProxy );
+ }
curl_setopt( $ch, CURLOPT_WRITEFUNCTION, array( $this, 'uploadCurlCallback' ) );
curl_exec( $ch );
$error = curl_errno( $ch ) ? true : false;
global $wgUser, $wgOut;
global $wgEnableUploads;
+ # Check php's file_uploads setting
+ if( !wfIniGetBool( 'file_uploads' ) ) {
+ $wgOut->showErrorPage( 'uploaddisabled', 'php-uploaddisabledtext', array( $this->mDesiredDestName ) );
+ return;
+ }
+
# Check uploading enabled
if( !$wgEnableUploads ) {
$wgOut->showErrorPage( 'uploaddisabled', 'uploaddisabledtext', array( $this->mDesiredDestName ) );
* @access private
*/
function processUpload(){
- global $wgUser, $wgOut, $wgFileExtensions;
+ global $wgOut, $wgFileExtensions, $wgLang;
$details = null;
$value = null;
$value = $this->internalProcessUpload( $details );
$this->mainUploadForm( wfMsgHtml( 'emptyfile' ) );
break;
- case self::MIN_LENGHT_PARTNAME:
+ case self::MIN_LENGTH_PARTNAME:
$this->mainUploadForm( wfMsgHtml( 'minlength1' ) );
break;
case self::OVERWRITE_EXISTING_FILE:
$errorText = $details['overwrite'];
- $overwrite = new WikiError( $wgOut->parse( $errorText ) );
- $this->uploadError( $overwrite->toString() );
+ $this->uploadError( $wgOut->parse( $errorText ) );
break;
case self::FILETYPE_MISSING:
wfMsgExt( 'filetype-banned-type',
array( 'parseinline' ),
htmlspecialchars( $finalExt ),
- implode(
- wfMsgExt( 'comma-separator', array( 'escapenoentities' ) ),
- $wgFileExtensions
- )
+ $wgLang->commaList( $wgFileExtensions ),
+ $wgLang->formatNum( count($wgFileExtensions) )
)
);
break;
if( !wfRunHooks( 'UploadForm:BeforeProcessing', array( &$this ) ) )
{
- wfDebug( "Hook 'UploadForm:BeforeProcessing' broke processing the file." );
+ wfDebug( "Hook 'UploadForm:BeforeProcessing' broke processing the file.\n" );
return self::BEFORE_PROCESSING;
}
return self::BEFORE_PROCESSING;
}
- # Chop off any directories in the given filename
+ /**
+ * Chop off any directories in the given filename. Then
+ * filter out illegal characters, and try to make a legible name
+ * out of it. We'll strip some silently that Title would die on.
+ */
if( $this->mDesiredDestName ) {
$basename = $this->mDesiredDestName;
} else {
$basename = $this->mSrcName;
}
- $filtered = wfBaseName( $basename );
-
+ $filtered = wfStripIllegalFilenameChars( $basename );
+
+ /* Normalize to title form before we do any further processing */
+ $nt = Title::makeTitleSafe( NS_FILE, $filtered );
+ if( is_null( $nt ) ) {
+ $resultDetails = array( 'filtered' => $filtered );
+ return self::ILLEGAL_FILENAME;
+ }
+ $filtered = $nt->getDBkey();
+
/**
* We'll want to blacklist against *any* 'extension', and use
* only the final one for the whitelist.
}
if( strlen( $partname ) < 1 ) {
- return self::MIN_LENGHT_PARTNAME;
+ return self::MIN_LENGTH_PARTNAME;
}
- /**
- * Filter out illegal characters, and try to make a legible name
- * out of it. We'll strip some silently that Title would die on.
- */
- $filtered = preg_replace ( "/[^".Title::legalChars()."]|:/", '-', $filtered );
- $nt = Title::makeTitleSafe( NS_IMAGE, $filtered );
- if( is_null( $nt ) ) {
- $resultDetails = array( 'filtered' => $filtered );
- return self::ILLEGAL_FILENAME;
- }
$this->mLocalFile = wfLocalFile( $nt );
$this->mDestName = $this->mLocalFile->getName();
if ( ! $this->mIgnoreWarning ) {
$warning = '';
- global $wgCapitalLinks;
- if( $wgCapitalLinks ) {
- $filtered = ucfirst( $filtered );
+ $comparableName = str_replace( ' ', '_', $basename );
+ global $wgCapitalLinks, $wgContLang;
+ if ( $wgCapitalLinks ) {
+ $comparableName = $wgContLang->ucfirst( $comparableName );
}
- if( $basename != $filtered ) {
+
+ if( $comparableName !== $filtered ) {
$warning .= '<li>'.wfMsgHtml( 'badfilename', htmlspecialchars( $this->mDestName ) ).'</li>';
}
global $wgCheckFileExtensions;
if ( $wgCheckFileExtensions ) {
if ( !$this->checkFileExtension( $finalExt, $wgFileExtensions ) ) {
+ global $wgLang;
$warning .= '<li>' .
wfMsgExt( 'filetype-unwanted-type',
array( 'parseinline' ),
htmlspecialchars( $finalExt ),
- implode(
- wfMsgExt( 'comma-separator', array( 'escapenoentities' ) ),
- $wgFileExtensions
- )
+ $wgLang->commaList( $wgFileExtensions ),
+ $wgLang->formatNum( count($wgFileExtensions) )
) . '</li>';
}
}
$warning .= self::getExistsWarning( $this->mLocalFile );
}
- $warning .= $this->getDupeWarning( $this->mTempPath );
+ $warning .= $this->getDupeWarning( $this->mTempPath, $finalExt, $nt );
if( $warning != '' ) {
/**
* Try actually saving the thing...
* It will show an error form on failure.
*/
- $pageText = self::getInitialPageText( $this->mComment, $this->mLicense,
- $this->mCopyrightStatus, $this->mCopyrightSource );
+ if( !$this->mForReUpload ) {
+ $pageText = self::getInitialPageText( $this->mComment, $this->mLicense,
+ $this->mCopyrightStatus, $this->mCopyrightSource );
+ }
$status = $this->mLocalFile->upload( $this->mTempPath, $this->mComment, $pageText,
File::DELETE_SOURCE, $this->mFileProps );
// extensions (eg 'jpg' rather than 'JPEG').
//
// Check for another file using the normalized form...
- $nt_lc = Title::makeTitle( NS_IMAGE, $partname . '.' . $file->getExtension() );
+ $nt_lc = Title::makeTitle( NS_FILE, $partname . '.' . $file->getExtension() );
$file_lc = wfLocalFile( $nt_lc );
} else {
$file_lc = false;
public static function ajaxGetLicensePreview( $license ) {
global $wgParser, $wgUser;
$text = '{{' . $license . '}}';
- $title = Title::makeTitle( NS_IMAGE, 'Sample.jpg' );
+ $title = Title::makeTitle( NS_FILE, 'Sample.jpg' );
$options = ParserOptions::newFromUser( $wgUser );
// Expand subst: first, then live templates...
* Check for duplicate files and throw up a warning before the upload
* completes.
*/
- function getDupeWarning( $tempfile ) {
+ function getDupeWarning( $tempfile, $extension, $destinationTitle ) {
$hash = File::sha1Base36( $tempfile );
$dupes = RepoGroup::singleton()->findBySha1( $hash );
+ $archivedImage = new ArchivedFile( null, 0, $hash.".$extension" );
if( $dupes ) {
global $wgOut;
$msg = "<gallery>";
foreach( $dupes as $file ) {
$title = $file->getTitle();
- $msg .= $title->getPrefixedText() .
- "|" . $title->getText() . "\n";
+ # Don't throw the warning when the titles are the same, it's a reupload
+ # and highly redundant.
+ if ( !$title->equals( $destinationTitle ) || !$this->mForReUpload ) {
+ $msg .= $title->getPrefixedText() .
+ "|" . $title->getText() . "\n";
+ }
}
$msg .= "</gallery>";
return "<li>" .
wfMsgExt( "file-exists-duplicate", array( "parse" ), count( $dupes ) ) .
$wgOut->parse( $msg ) .
"</li>\n";
+ } elseif ( $archivedImage->getID() > 0 ) {
+ global $wgOut;
+ $name = Title::makeTitle( NS_FILE, $archivedImage->getName() )->getPrefixedText();
+ return Xml::tags( 'li', null, wfMsgExt( 'file-deleted-duplicate', array( 'parseinline' ), array( $name ) ) );
} else {
return '';
}
*/
function unsaveUploadedFile() {
global $wgOut;
+ if( !$this->mTempPath ) return true; // nothing to delete
$repo = RepoGroup::singleton()->getLocalRepo();
$success = $repo->freeTemp( $this->mTempPath );
if ( ! $success ) {
if( !wfRunHooks( 'UploadForm:initial', array( &$this ) ) )
{
- wfDebug( "Hook 'UploadForm:initial' broke output of the upload form" );
+ wfDebug( "Hook 'UploadForm:initial' broke output of the upload form\n" );
return false;
}
if( $this->mDesiredDestName ) {
- $title = Title::makeTitleSafe( NS_IMAGE, $this->mDesiredDestName );
+ $title = Title::makeTitleSafe( NS_FILE, $this->mDesiredDestName );
// Show a subtitle link to deleted revisions (to sysops et al only)
if( $title instanceof Title && ( $count = $title->isDeleted() ) > 0 && $wgUser->isAllowed( 'deletedhistory' ) ) {
$link = wfMsgExt(
wfMsgExt( 'restorelink', array( 'parsemag', 'escape' ), $count )
)
);
- $wgOut->addHtml( "<div id=\"contentSub2\">{$link}</div>" );
+ $wgOut->addHTML( "<div id=\"contentSub2\">{$link}</div>" );
}
// Show the relevant lines from deletion log (for still deleted files only)
- if( $title instanceof Title && $title->isDeleted() > 0 && !$title->exists() ) {
+ if( $title instanceof Title && $title->isDeletedQuick() && !$title->exists() ) {
$this->showDeletionLog( $wgOut, $title->getPrefixedText() );
}
}
$allowedExtensions = '';
if( $wgCheckFileExtensions ) {
- $delim = wfMsgExt( 'comma-separator', array( 'escapenoentities' ) );
if( $wgStrictFileExtensions ) {
# Everything not permitted is banned
$extensionsList =
'<div id="mw-upload-permitted">' .
- wfMsgWikiHtml( 'upload-permitted', implode( $wgFileExtensions, $delim ) ) .
+ wfMsgWikiHtml( 'upload-permitted', $wgLang->commaList( $wgFileExtensions ) ) .
"</div>\n";
} else {
# We have to list both preferred and prohibited
$extensionsList =
'<div id="mw-upload-preferred">' .
- wfMsgWikiHtml( 'upload-preferred', implode( $wgFileExtensions, $delim ) ) .
+ wfMsgWikiHtml( 'upload-preferred', $wgLang->commaList( $wgFileExtensions ) ) .
"</div>\n" .
'<div id="mw-upload-prohibited">' .
- wfMsgWikiHtml( 'upload-prohibited', implode( $wgFileBlacklist, $delim ) ) .
+ wfMsgWikiHtml( 'upload-prohibited', $wgLang->commaList( $wgFileBlacklist ) ) .
"</div>\n";
}
} else {
$sourcefilename = wfMsgExt( 'sourcefilename', array( 'parseinline', 'escapenoentities' ) );
$destfilename = wfMsgExt( 'destfilename', array( 'parseinline', 'escapenoentities' ) );
- $summary = wfMsgExt( 'fileuploadsummary', 'parseinline' );
+ $msg = $this->mForReUpload ? 'filereuploadsummary' : 'fileuploadsummary';
+ $summary = wfMsgExt( $msg, 'parseinline' );
$licenses = new Licenses();
$license = wfMsgExt( 'license', array( 'parseinline' ) );
$encDestName = htmlspecialchars( $this->mDesiredDestName );
- $watchChecked = $this->watchCheck()
- ? 'checked="checked"'
- : '';
- $warningChecked = $this->mIgnoreWarning ? 'checked' : '';
+ $watchChecked = $this->watchCheck() ? 'checked="checked"' : '';
+ # Re-uploads should not need "file exist already" warnings
+ $warningChecked = ($this->mIgnoreWarning || $this->mForReUpload) ? 'checked="checked"' : '';
// Prepare form for upload or upload/copy
if( $wgAllowCopyUploads && $wgUser->isAllowed( 'upload_by_url' ) ) {
$warningRow = '';
$destOnkeyup = '';
}
-
$encComment = htmlspecialchars( $this->mComment );
+
$wgOut->addHTML(
Xml::openElement( 'form', array( 'method' => 'post', 'action' => $titleObj->getLocalURL(),
<td class='mw-label'>
<label for='wpDestFile'>{$destfilename}</label>
</td>
- <td class='mw-input'>
- <input tabindex='2' type='text' name='wpDestFile' id='wpDestFile' size='60'
- value=\"{$encDestName}\" onchange='toggleFilenameFiller()' $destOnkeyup />
- </td>
+ <td class='mw-input'>"
+ );
+ if( $this->mForReUpload ) {
+ $wgOut->addHTML(
+ Xml::hidden( 'wpDestFile', $this->mDesiredDestName, array('id'=>'wpDestFile','tabindex'=>2) ) .
+ "<tt>" .
+ $encDestName .
+ "</tt>"
+ );
+ }
+ else {
+ $wgOut->addHTML(
+ "<input tabindex='2' type='text' name='wpDestFile' id='wpDestFile' size='60'
+ value=\"{$encDestName}\" onchange='toggleFilenameFiller()' $destOnkeyup />"
+ );
+ }
+
+
+ $wgOut->addHTML(
+ "</td>
</tr>
<tr>
<td class='mw-label'>
</tr>
<tr>"
);
-
- if ( $licenseshtml != '' ) {
+ # Re-uploads should not need license info
+ if ( !$this->mForReUpload && $licenseshtml != '' ) {
global $wgStylePath;
$wgOut->addHTML( "
<td class='mw-label'>
<tr>"
);
if( $useAjaxLicensePreview ) {
- $wgOut->addHtml( "
+ $wgOut->addHTML( "
<td></td>
<td id=\"mw-license-preview\"></td>
</tr>
}
}
- if ( $wgUseCopyrightUpload ) {
+ if ( !$this->mForReUpload && $wgUseCopyrightUpload ) {
$filestatus = wfMsgExt( 'filestatus', 'escapenoentities' );
$copystatus = htmlspecialchars( $this->mCopyrightStatus );
$filesource = wfMsgExt( 'filesource', 'escapenoentities' );
);
}
- $wgOut->addHtml( "
+ $wgOut->addHTML( "
<td></td>
<td>
<input tabindex='7' type='checkbox' name='wpWatchthis' id='wpWatchthis' $watchChecked value='true' />
<label for='wpWatchthis'>" . wfMsgHtml( 'watchthisupload' ) . "</label>
- <input tabindex='8' type='checkbox' name='wpIgnoreWarning' id='wpIgnoreWarning' value='true' $warningChecked/>
+ <input tabindex='8' type='checkbox' name='wpIgnoreWarning' id='wpIgnoreWarning' value='true' $warningChecked />
<label for='wpIgnoreWarning'>" . wfMsgHtml( 'ignorewarnings' ) . "</label>
</td>
</tr>
<tr>
<td></td>
<td class='mw-input'>
- <input tabindex='9' type='submit' name='wpUpload' value=\"{$ulb}\"" . $wgUser->getSkin()->tooltipAndAccesskey( 'upload' ) . " />
+ <input tabindex='9' type='submit' name='wpUpload' value=\"{$ulb}\"" .
+ $wgUser->getSkin()->tooltipAndAccesskey( 'upload' ) . " />
</td>
</tr>
<tr>
<td></td>
<td class='mw-input'>"
);
- $wgOut->addWikiText( wfMsgForContent( 'edittools' ) );
+ $wgOut->addHTML( '<div class="mw-editTools">' );
+ $wgOut->addWikiMsgArray( 'edittools', array(), array( 'content' ) );
+ $wgOut->addHTML( '</div>' );
$wgOut->addHTML( "
</td>
</tr>" .
Xml::closeElement( 'table' ) .
Xml::hidden( 'wpDestFileWarningAck', '', array( 'id' => 'wpDestFileWarningAck' ) ) .
+ Xml::hidden( 'wpForReUpload', $this->mForReUpload, array( 'id' => 'wpForReUpload' ) ) .
Xml::closeElement( 'fieldset' ) .
Xml::closeElement( 'form' )
);
*
* @return array
*/
- function splitExtensions( $filename ) {
+ public function splitExtensions( $filename ) {
$bits = explode( '.', $filename );
$basename = array_shift( $bits );
return array( $basename, $bits );
* @param array $list
* @return bool
*/
- function checkFileExtensionList( $ext, $list ) {
+ public function checkFileExtensionList( $ext, $list ) {
foreach( $ext as $e ) {
if( in_array( strtolower( $e ), $list ) ) {
return true;
$magic = MimeMagic::singleton();
$mime = $magic->guessMimeType($tmpfile,false);
+
#check mime type, if desired
global $wgVerifyMimeType;
if ($wgVerifyMimeType) {
-
- wfDebug ( "\n\nmime: <$mime> extension: <$extension>\n\n");
+ wfDebug ( "\n\nmime: <$mime> extension: <$extension>\n\n");
#check mime type against file extension
if( !self::verifyExtension( $mime, $extension ) ) {
return new WikiErrorMsg( 'uploadcorrupt' );
#check mime type blacklist
global $wgMimeTypeBlacklist;
- if( isset($wgMimeTypeBlacklist) && !is_null($wgMimeTypeBlacklist)
- && $this->checkFileExtension( $mime, $wgMimeTypeBlacklist ) ) {
- return new WikiErrorMsg( 'filetype-badmime', htmlspecialchars( $mime ) );
+ if( isset($wgMimeTypeBlacklist) && !is_null($wgMimeTypeBlacklist) ) {
+ if ( $this->checkFileExtension( $mime, $wgMimeTypeBlacklist ) ) {
+ return new WikiErrorMsg( 'filetype-badmime', htmlspecialchars( $mime ) );
+ }
+
+ # Check IE type
+ $fp = fopen( $tmpfile, 'rb' );
+ $chunk = fread( $fp, 256 );
+ fclose( $fp );
+ $extMime = $magic->guessTypesForExtension( $extension );
+ $ieTypes = $magic->getIEMimeTypes( $tmpfile, $chunk, $extMime );
+ foreach ( $ieTypes as $ieType ) {
+ if ( $this->checkFileExtension( $ieType, $wgMimeTypeBlacklist ) ) {
+ return new WikiErrorMsg( 'filetype-bad-ie-mime', $ieType );
+ }
+ }
}
}
if( $this->detectScript ( $tmpfile, $mime, $extension ) ) {
return new WikiErrorMsg( 'uploadscripted' );
}
+ if( $extension == 'svg' || $mime == 'image/svg+xml' ) {
+ if( $this->detectScriptInSvg( $tmpfile ) ) {
+ return new WikiErrorMsg( 'uploadscripted' );
+ }
+ }
/**
* Scan the uploaded file for viruses
}
}
+
/**
* Heuristic for detecting files that *could* contain JavaScript instructions or
* things that may look like HTML to a browser and are thus
*/
$tags = array(
+ '<a href',
'<body',
'<head',
'<html', #also in safari
return false;
}
+ function detectScriptInSvg( $filename ) {
+ $check = new XmlTypeCheck( $filename, array( $this, 'checkSvgScriptCallback' ) );
+ return $check->filterMatch;
+ }
+
+ /**
+ * @todo Replace this with a whitelist filter!
+ */
+ function checkSvgScriptCallback( $element, $attribs ) {
+ $stripped = $this->stripXmlNamespace( $element );
+
+ if( $stripped == 'script' ) {
+ wfDebug( __METHOD__ . ": Found script element '$element' in uploaded file.\n" );
+ return true;
+ }
+
+ foreach( $attribs as $attrib => $value ) {
+ $stripped = $this->stripXmlNamespace( $attrib );
+ if( substr( $stripped, 0, 2 ) == 'on' ) {
+ wfDebug( __METHOD__ . ": Found script attribute '$attrib'='value' in uploaded file.\n" );
+ return true;
+ }
+ if( $stripped == 'href' && strpos( strtolower( $value ), 'javascript:' ) !== false ) {
+ wfDebug( __METHOD__ . ": Found script href attribute '$attrib'='$value' in uploaded file.\n" );
+ return true;
+ }
+ }
+ }
+
+ private function stripXmlNamespace( $name ) {
+ // 'http://www.w3.org/2000/svg:script' -> 'script'
+ $parts = explode( ':', strtolower( $name ) );
+ return array_pop( $parts );
+ }
+
/**
* Generic wrapper function for a virus scanner program.
* This relies on the $wgAntivirus and $wgAntivirusSetup variables.
if ( !$wgAntivirusSetup[$wgAntivirus] ) {
wfDebug( __METHOD__.": unknown virus scanner: $wgAntivirus\n" );
- # @TODO: localise
- $wgOut->addHTML( "<div class='error'>Bad configuration: unknown virus scanner: <i>$wgAntivirus</i></div>\n" );
- return "unknown antivirus: $wgAntivirus";
+ $wgOut->wrapWikiMsg( '<div class="error">$1</div>', array( 'virus-badscanner', $wgAntivirus ) );
+ return wfMsg('virus-unknownscanner') . " $wgAntivirus";
}
# look up scanner configuration
wfDebug( __METHOD__.": failed to scan $file (code $exitCode).\n" );
if ( $wgAntivirusRequired ) {
- return "scan failed (code $exitCode)";
+ return wfMsg('virus-scanfailed', array( $exitCode ) );
} else {
return NULL;
}
}
}
- wfDebug( __METHOD__.": FOUND VIRUS! scanner feedback: $output" );
+ wfDebug( __METHOD__.": FOUND VIRUS! scanner feedback: $output \n" );
return $output;
}
}
* @access private
*/
function cleanupTempFile() {
- if ( $this->mRemoveTempFile && file_exists( $this->mTempPath ) ) {
+ if ( $this->mRemoveTempFile && $this->mTempPath && file_exists( $this->mTempPath ) ) {
wfDebug( "SpecialUpload::cleanupTempFile: Removing temporary file {$this->mTempPath}\n" );
unlink( $this->mTempPath );
}
function showError( $description ) {
global $wgOut;
$wgOut->setPageTitle( wfMsg( "internalerror" ) );
- $wgOut->setRobotpolicy( "noindex,nofollow" );
+ $wgOut->setRobotPolicy( "noindex,nofollow" );
$wgOut->setArticleRelated( false );
$wgOut->enableClientCache( false );
$wgOut->addWikiText( $description );
$loglist = new LogEventsList( $wgUser->getSkin(), $out );
$pager = new LogPager( $loglist, 'delete', false, $filename );
if( $pager->getNumRows() > 0 ) {
- $out->addHtml( '<div id="mw-upload-deleted-warn">' );
+ $out->addHTML( '<div class="mw-warning-with-logexcerpt">' );
$out->addWikiMsg( 'upload-wasdeleted' );
$out->addHTML(
$loglist->beginLogEventsList() .
$pager->getBody() .
$loglist->endLogEventsList()
);
- $out->addHtml( '</div>' );
+ $out->addHTML( '</div>' );
}
}
}