From c43084804395535285a062d62b96631359b8c4b0 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sun, 2 Apr 2006 03:59:07 +0000 Subject: [PATCH] Live hack: Skip some work on empty category/link sets --- includes/OutputPage.php | 6 ++++++ 1 file changed, 6 insertions(+) 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 ); -- 2.20.1