Merge "Make it work even on imports when title is null."

This commit is contained in:
Demon 2013-05-11 03:54:40 +00:00 committed by Gerrit Code Review
commit 026ec5dec6

View file

@ -51,19 +51,24 @@ class VoteHooks {
$type = intval( $args['type'] );
}
$articleID = $wgOut->getTitle()->getArticleID();
switch( $type ) {
case 0:
$vote = new Vote( $articleID );
break;
case 1:
$vote = new VoteStars( $articleID );
break;
default:
$vote = new Vote( $articleID );
}
$output = null;
$title = $wgOut->getTitle();
if( $title ) {
$output = $vote->display();
$articleID = $title->getArticleID();
switch( $type ) {
case 0:
$vote = new Vote( $articleID );
break;
case 1:
$vote = new VoteStars( $articleID );
break;
default:
$vote = new Vote( $articleID );
}
$output = $vote->display();
}
wfProfileOut( __METHOD__ );