From ead951a4ad6782b21497c586e8b32fe7400c80c1 Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Fri, 19 Aug 2011 23:30:12 +0000 Subject: [PATCH] Couple more pieces of wikia upstreaming --- includes/ChangesFeed.php | 5 +++++ includes/FileDeleteForm.php | 12 ++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/includes/ChangesFeed.php b/includes/ChangesFeed.php index c4c4a8a1be..bcedf2f329 100644 --- a/includes/ChangesFeed.php +++ b/includes/ChangesFeed.php @@ -34,6 +34,11 @@ class ChangesFeed { return false; } + if( !array_key_exists( $this->format, $wgFeedClasses ) ) { + // falling back to atom + $this->format = 'atom'; + } + $feedTitle = "$wgSitename - {$title} [$wgLanguageCode]"; return new $wgFeedClasses[$this->format]( $feedTitle, htmlspecialchars( $description ), $url ); diff --git a/includes/FileDeleteForm.php b/includes/FileDeleteForm.php index 515768ff7c..e2c95c2e0b 100644 --- a/includes/FileDeleteForm.php +++ b/includes/FileDeleteForm.php @@ -37,7 +37,7 @@ class FileDeleteForm { return; } $permission_errors = $this->title->getUserPermissionsErrors('delete', $wgUser); - if (count($permission_errors)>0) { + if ( count( $permission_errors ) > 0 ) { $wgOut->showPermissionsErrorPage( $permission_errors ); return; } @@ -74,8 +74,12 @@ class FileDeleteForm { $status = self::doDelete( $this->title, $this->file, $this->oldimage, $reason, $suppress ); - if( !$status->isGood() ) + if( !$status->isGood() ) { + $wgOut->addHTML( '

' . $this->prepareMessage( 'filedeleteerror-short' ) . "

\n" ); + $wgOut->addHTML( '' ); $wgOut->addWikiText( $status->getWikiText( 'filedeleteerror-short', 'filedeleteerror-long' ) ); + $wgOut->addHTML( '' ); + } if( $status->ok ) { $wgOut->setPagetitle( wfMsg( 'actioncomplete' ) ); $wgOut->addHTML( $this->prepareMessage( 'filedelete-success' ) ); @@ -141,7 +145,7 @@ class FileDeleteForm { throw $e; } } - if( $status->isGood() ) + if( $status->isGood() ) wfRunHooks('FileDeleteComplete', array( &$file, &$oldimage, &$article, &$wgUser, &$reason)); return $status; @@ -193,7 +197,7 @@ class FileDeleteForm { " {$suppress}"; - if( $wgUser->isLoggedIn() ) { + if( $wgUser->isLoggedIn() ) { $form .= " -- 2.20.1