foreach ( [ 'from', 'to' ] as $prefix ) {
if ( $params["{$prefix}rev"] !== null ) {
$rev = $this->getRevisionById( $params["{$prefix}rev"] );
- if ( $rev ) {
- if ( $rev->hasSlot( $role ) ) {
- return $rev->getSlot( $role, RevisionRecord::RAW )->getModel();
- }
+ if ( $rev && $rev->hasSlot( $role ) ) {
+ return $rev->getSlot( $role, RevisionRecord::RAW )->getModel();
}
}
}
*/
private function setVals( &$vals, $prefix, $rev ) {
if ( $rev ) {
- $title = $rev->getPageAsLinkTarget();
+ $title = Title::newFromLinkTarget( $rev->getPageAsLinkTarget() );
if ( isset( $this->props['ids'] ) ) {
$vals["{$prefix}id"] = $title->getArticleID();
$vals["{$prefix}revid"] = $rev->getId();
$vals["{$prefix}comment"] = $comment->text;
}
$vals["{$prefix}parsedcomment"] = Linker::formatComment(
- $comment->text, Title::newFromLinkTarget( $title )
+ $comment->text, $title
);
}
}