From: Aaron Schulz Date: Mon, 6 Apr 2009 02:11:42 +0000 (+0000) Subject: * Made generateReason() skip deleted user names X-Git-Tag: 1.31.0-rc.0~42214 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=028357555f72a59c1d8b75a39c28816528a185df;p=lhc%2Fweb%2Fwiklou.git * Made generateReason() skip deleted user names --- diff --git a/includes/Article.php b/includes/Article.php index 4a93240957..f77e246b82 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -2185,18 +2185,16 @@ class Article { // Find out if there was only one contributor // Only scan the last 20 revisions - $limit = 20; $res = $dbw->select( 'revision', 'rev_user_text', - array( 'rev_page' => $this->getID() ), __METHOD__, - array( 'LIMIT' => $limit ) + array( 'rev_page' => $this->getID(), 'rev_deleted & '.Revision::DELETED_USER.'=0' ), + __METHOD__, + array( 'LIMIT' => 20 ) ); if( $res === false ) // This page has no revisions, which is very weird return false; - if( $res->numRows() > 1 ) - $hasHistory = true; - else - $hasHistory = false; + + $hasHistory = ( $res->numRows() > 1 ); $row = $dbw->fetchObject( $res ); $onlyAuthor = $row->rev_user_text; // Try to find a second contributor