Merge "Error Msg for missing db username & password when installing"
[lhc/web/wiklou.git] / includes / specials / SpecialContributions.php
index fdb781b..51606b7 100644 (file)
@@ -26,7 +26,6 @@
  *
  * @ingroup SpecialPage
  */
-
 class SpecialContributions extends IncludableSpecialPage {
        protected $opts;
 
@@ -66,6 +65,7 @@ class SpecialContributions extends IncludableSpecialPage {
                        if ( !$this->including() ) {
                                $out->addHTML( $this->getForm() );
                        }
+
                        return;
                }
 
@@ -323,6 +323,16 @@ class SpecialContributions extends IncludableSpecialPage {
                                array(),
                                array( 'page' => $userpage->getPrefixedText() )
                        );
+
+                       # Suppression log link (bug 59120)
+                       if ( $this->getUser()->isAllowed( 'suppressionlog' ) ) {
+                               $tools[] = Linker::linkKnown(
+                                       SpecialPage::getTitleFor( 'Log', 'suppress' ),
+                                       $this->msg( 'sp-contributions-suppresslog' )->escaped(),
+                                       array(),
+                                       array( 'offender' => $username )
+                               );
+                       }
                }
                # Uploads
                $tools[] = Linker::linkKnown(
@@ -941,8 +951,12 @@ class ContribsPager extends ReverseChronologicalPager {
                 * to extensions to subscribe to the hook to parse the row.
                 */
                wfSuppressWarnings();
-               $rev = new Revision( $row );
-               $validRevision = (bool)$rev->getId();
+               try {
+                       $rev = new Revision( $row );
+                       $validRevision = (bool)$rev->getId();
+               } catch ( MWException $e ) {
+                       $validRevision = false;
+               }
                wfRestoreWarnings();
 
                if ( $validRevision ) {
@@ -1081,7 +1095,7 @@ class ContribsPager extends ReverseChronologicalPager {
                wfRunHooks( 'ContributionsLineEnding', array( $this, &$ret, $row, &$classes ) );
 
                if ( $classes === array() && $ret === '' ) {
-                       wfDebug( 'Dropping Special:Contribution row that could not be formatted' );
+                       wfDebug( "Dropping Special:Contribution row that could not be formatted\n" );
                        $ret = "<!-- Could not format Special:Contribution row. -->\n";
                } else {
                        $ret = Html::rawElement( 'li', array( 'class' => $classes ), $ret ) . "\n";