summaryrefslogtreecommitdiff
path: root/includes/FileDeleteForm.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2011-12-03 13:29:22 +0100
committerPierre Schmitz <pierre@archlinux.de>2011-12-03 13:29:22 +0100
commitca32f08966f1b51fcb19460f0996bb0c4048e6fe (patch)
treeec04cc15b867bc21eedca904cea9af0254531a11 /includes/FileDeleteForm.php
parenta22fbfc60f36f5f7ee10d5ae6fe347340c2ee67c (diff)
Update to MediaWiki 1.18.0
* also update ArchLinux skin to chagnes in MonoBook * Use only css to hide our menu bar when printing
Diffstat (limited to 'includes/FileDeleteForm.php')
-rw-r--r--includes/FileDeleteForm.php36
1 files changed, 16 insertions, 20 deletions
diff --git a/includes/FileDeleteForm.php b/includes/FileDeleteForm.php
index 030330bb..515768ff 100644
--- a/includes/FileDeleteForm.php
+++ b/includes/FileDeleteForm.php
@@ -118,25 +118,21 @@ class FileDeleteForm {
} else {
$id = $title->getArticleID( Title::GAID_FOR_UPDATE );
$article = new Article( $title );
- $error = '';
$dbw = wfGetDB( DB_MASTER );
try {
- if( wfRunHooks( 'ArticleDelete', array( &$article, &$wgUser, &$reason, &$error ) ) ) {
- // delete the associated article first
- if( $article->doDeleteArticle( $reason, $suppress, $id, false ) ) {
- global $wgRequest;
- if( $wgRequest->getCheck( 'wpWatch' ) && $wgUser->isLoggedIn() ) {
- $article->doWatch();
- } elseif( $title->userIsWatching() ) {
- $article->doUnwatch();
- }
- $status = $file->delete( $reason, $suppress );
- if( $status->ok ) {
- $dbw->commit();
- wfRunHooks( 'ArticleDeleteComplete', array( &$article, &$wgUser, $reason, $id ) );
- } else {
- $dbw->rollback();
- }
+ // delete the associated article first
+ if( $article->doDeleteArticle( $reason, $suppress, $id, false ) ) {
+ global $wgRequest;
+ if ( $wgRequest->getCheck( 'wpWatch' ) && $wgUser->isLoggedIn() ) {
+ WatchAction::doWatch( $title, $wgUser );
+ } elseif ( $title->userIsWatching() ) {
+ WatchAction::doUnwatch( $title, $wgUser );
+ }
+ $status = $file->delete( $reason, $suppress );
+ if( $status->ok ) {
+ $dbw->commit();
+ } else {
+ $dbw->rollback();
}
}
} catch ( MWException $e ) {
@@ -257,15 +253,15 @@ class FileDeleteForm {
return wfMsgExt(
"{$message}-old", # To ensure grep will find them: 'filedelete-intro-old', 'filedelete-nofile-old', 'filedelete-success-old'
'parse',
- $this->title->getText(),
+ wfEscapeWikiText( $this->title->getText() ),
$wgLang->date( $this->getTimestamp(), true ),
$wgLang->time( $this->getTimestamp(), true ),
- wfExpandUrl( $this->file->getArchiveUrl( $this->oldimage ) ) );
+ wfExpandUrl( $this->file->getArchiveUrl( $this->oldimage ), PROTO_CURRENT ) );
} else {
return wfMsgExt(
$message,
'parse',
- $this->title->getText()
+ wfEscapeWikiText( $this->title->getText() )
);
}
}