From 789aac0eab97d011870e536199f5777cb4a5d19e Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 27 Nov 2007 20:16:42 +0000 Subject: [PATCH] * Fix breakage in rcFilterByCategories when invalid titles present in DB; incorrect usage of Title::newFromText() * Don't bother filtering in rcFilterByCategories if there are no categories to filter by --- includes/SpecialRecentchanges.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/includes/SpecialRecentchanges.php b/includes/SpecialRecentchanges.php index 4fae63511e..ff14b9f391 100644 --- a/includes/SpecialRecentchanges.php +++ b/includes/SpecialRecentchanges.php @@ -267,6 +267,10 @@ function wfSpecialRecentchanges( $par, $specialPage ) { } function rcFilterByCategories ( &$rows , $categories , $any ) { + if( empty( $categories ) ) { + return; + } + # Filter categories $cats = array () ; foreach ( $categories AS $cat ) { @@ -279,7 +283,7 @@ function rcFilterByCategories ( &$rows , $categories , $any ) { $articles = array () ; $a2r = array () ; foreach ( $rows AS $k => $r ) { - $nt = Title::newFromText ( $r->rc_title , $r->rc_namespace ) ; + $nt = Title::makeTitle( $r->rc_title , $r->rc_namespace ); $id = $nt->getArticleID() ; if ( $id == 0 ) continue ; # Page might have been deleted... if ( !in_array ( $id , $articles ) ) { -- 2.20.1