From: Tobias Date: Mon, 29 Mar 2010 19:45:54 +0000 (+0000) Subject: (bug 22627) Remove PHP notice when deleting a page only hidden users edited. X-Git-Tag: 1.31.0-rc.0~37313 X-Git-Url: http://git.cyclocoop.org/%24self?a=commitdiff_plain;h=2ca46efd6e8591c0e234c3954ceb15b260a6a3f8;p=lhc%2Fweb%2Fwiklou.git (bug 22627) Remove PHP notice when deleting a page only hidden users edited. --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 2ddf0b5d9e..ea7a829b31 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -66,6 +66,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN links with non-NFC character references work correctly. * (bug 22991) wgUserGroups JavaScript variable now reports * group for anonymous users instead of null. +* (bug 22627) Remove PHP notice when deleting a page only hidden users edited. == API changes in 1.17 == * (bug 22738) Allow filtering by action type on query=logevent diff --git a/includes/Article.php b/includes/Article.php index d0f8f7444f..eface19f8b 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -2545,13 +2545,17 @@ class Article { $hasHistory = ( $res->numRows() > 1 ); $row = $dbw->fetchObject( $res ); - $onlyAuthor = $row->rev_user_text; - // Try to find a second contributor - foreach ( $res as $row ) { - if ( $row->rev_user_text != $onlyAuthor ) { - $onlyAuthor = false; - break; + if ( $row ) { // $row is false if the only contributor is hidden + $onlyAuthor = $row->rev_user_text; + // Try to find a second contributor + foreach ( $res as $row ) { + if ( $row->rev_user_text != $onlyAuthor ) { // Bug 22999 + $onlyAuthor = false; + break; + } } + } else { + $onlyAuthor = false; } $dbw->freeResult( $res );