r95059 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r95058‎ | r95059 | r95060 >
Date:23:30, 19 August 2011
Author:reedy
Status:ok (Comments)
Tags:
Comment:
Couple more pieces of wikia upstreaming
Modified paths:
  • /trunk/phase3/includes/ChangesFeed.php (modified) (history)
  • /trunk/phase3/includes/FileDeleteForm.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/ChangesFeed.php
@@ -34,6 +34,11 @@
3535 return false;
3636 }
3737
 38+ if( !array_key_exists( $this->format, $wgFeedClasses ) ) {
 39+ // falling back to atom
 40+ $this->format = 'atom';
 41+ }
 42+
3843 $feedTitle = "$wgSitename - {$title} [$wgLanguageCode]";
3944 return new $wgFeedClasses[$this->format](
4045 $feedTitle, htmlspecialchars( $description ), $url );
Index: trunk/phase3/includes/FileDeleteForm.php
@@ -37,7 +37,7 @@
3838 return;
3939 }
4040 $permission_errors = $this->title->getUserPermissionsErrors('delete', $wgUser);
41 - if (count($permission_errors)>0) {
 41+ if ( count( $permission_errors ) > 0 ) {
4242 $wgOut->showPermissionsErrorPage( $permission_errors );
4343 return;
4444 }
@@ -74,8 +74,12 @@
7575
7676 $status = self::doDelete( $this->title, $this->file, $this->oldimage, $reason, $suppress );
7777
78 - if( !$status->isGood() )
 78+ if( !$status->isGood() ) {
 79+ $wgOut->addHTML( '<h2>' . $this->prepareMessage( 'filedeleteerror-short' ) . "</h2>\n" );
 80+ $wgOut->addHTML( '<span class="error">' );
7981 $wgOut->addWikiText( $status->getWikiText( 'filedeleteerror-short', 'filedeleteerror-long' ) );
 82+ $wgOut->addHTML( '</span>' );
 83+ }
8084 if( $status->ok ) {
8185 $wgOut->setPagetitle( wfMsg( 'actioncomplete' ) );
8286 $wgOut->addHTML( $this->prepareMessage( 'filedelete-success' ) );
@@ -141,7 +145,7 @@
142146 throw $e;
143147 }
144148 }
145 - if( $status->isGood() )
 149+ if( $status->isGood() )
146150 wfRunHooks('FileDeleteComplete', array( &$file, &$oldimage, &$article, &$wgUser, &$reason));
147151
148152 return $status;
@@ -193,7 +197,7 @@
194198 "</td>
195199 </tr>
196200 {$suppress}";
197 - if( $wgUser->isLoggedIn() ) {
 201+ if( $wgUser->isLoggedIn() ) {
198202 $form .= "
199203 <tr>
200204 <td></td>

Sign-offs

UserFlagDate
Nikerabbitinspected13:37, 20 August 2011

Comments

#Comment by Nikerabbit (talk | contribs)   13:37, 20 August 2011

isset?

#Comment by Bawolff (talk | contribs)   00:06, 10 September 2011

Why would we want to fallback to an atom feed if the user gives us some sort of other feed type. Giving the user an error message seems to make more sense imo (but i guess it really doesn't matter).

Status & tagging log