From 2ca46efd6e8591c0e234c3954ceb15b260a6a3f8 Mon Sep 17 00:00:00 2001 From: Tobias Date: Mon, 29 Mar 2010 19:45:54 +0000 Subject: [PATCH] (bug 22627) Remove PHP notice when deleting a page only hidden users edited. --- RELEASE-NOTES | 1 + includes/Article.php | 16 ++++++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) 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 ); -- 2.20.1