From: Brion Vibber Date: Sun, 2 Apr 2006 03:59:07 +0000 (+0000) Subject: Live hack: Skip some work on empty category/link sets X-Git-Tag: 1.6.0~73 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22auteur_infos%22%2C%20%22id_auteur=%24id%22%29%20.%20%22?a=commitdiff_plain;h=c43084804395535285a062d62b96631359b8c4b0;p=lhc%2Fweb%2Fwiklou.git Live hack: Skip some work on empty category/link sets --- diff --git a/includes/OutputPage.php b/includes/OutputPage.php index b8ab62e09c..fa8c2fadb0 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -217,6 +217,9 @@ class OutputPage { function addCategoryLinks($categories) { global $wgUser, $wgContLang; + if ( !is_array( $categories ) ) { + return; + } # Add the links to the link cache in a batch $arr = array( NS_CATEGORY => $categories ); $lb = new LinkBatch; @@ -901,6 +904,9 @@ class OutputPage { $this->addKeyword( $wgTitle->getPrefixedText() ); $count = 1; $links2d =& $parserOutput->getLinks(); + if ( !is_array( $links2d ) ) { + return; + } foreach ( $links2d as $ns => $dbkeys ) { foreach( $dbkeys as $dbkey => $id ) { $this->addKeyword( $dbkey );