while ( $x = wfFetchObject ( $res ) ) $data[] = $x ;
wfFreeResult ( $res ) ;
} else {
- $data = "";
+ $data = '';
}
return $data;
}
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
{
# 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<br/>\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 .= "<br/>\n";
# now we can empty the stack
$stack = array();
}
if(isset($result)) { return $result; }
- else { return ""; };
+ else { return ''; };
}