From: Brion Vibber Date: Tue, 27 Nov 2007 20:16:42 +0000 (+0000) Subject: * Fix breakage in rcFilterByCategories when invalid titles present in DB; incorrect... X-Git-Tag: 1.31.0-rc.0~50701 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/?a=commitdiff_plain;h=789aac0eab97d011870e536199f5777cb4a5d19e;p=lhc%2Fweb%2Fwiklou.git * 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 --- 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 ) ) {