From bb1f69c9b1a9e445c8d39c310045d39a040bd551 Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Thu, 10 Jun 2004 10:54:41 +0000 Subject: [PATCH] function getAllParentCategories:\n - possible notice fix\n - single to double quote --- includes/Title.php | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/includes/Title.php b/includes/Title.php index 422392f259..85b16edc2f 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -1189,7 +1189,7 @@ class Title { while ( $x = wfFetchObject ( $res ) ) $data[] = $x ; wfFreeResult ( $res ) ; } else { - $data = ""; + $data = ''; } return $data; } @@ -1200,12 +1200,12 @@ class Title { function getAllParentCategories(&$stack) { global $wgUser,$wgLang; - $result = ""; + $result = ''; # getting parents $parents = $this->getParentCategories( ); - if($parents == "") + if($parents == '') { # The current element has no more parent so we dump the stack # and make a clean line of categories @@ -1215,11 +1215,15 @@ class Title { { # make a link of that parent $result .= $sk->makeLink($wgLang->getNSText ( Namespace::getCategory() ).":".$parent,$parent); - $result .= " > "; + $result .= ' > '; $lastchild = $child; } - # append the last child - $result .= "$lastchild
\n"; + # append the last child. + # TODO : We should have a last child unless there is an error in the + # "categorylinks" table. + if(isset($lastchild) { $result .= $lastchild; } + + $result .= "
\n"; # now we can empty the stack $stack = array(); @@ -1238,7 +1242,7 @@ class Title { } if(isset($result)) { return $result; } - else { return ""; }; + else { return ''; }; } -- 2.20.1