Index: branches/Wikidata/phase3/includes/api/ApiQueryRevisions.php |
— | — | @@ -503,11 +503,13 @@ |
504 | 504 | $vals['diff'] = array(); |
505 | 505 | $context = new DerivativeContext( $this->getContext() ); |
506 | 506 | $context->setTitle( $title ); |
| 507 | + $handler = ContentHandler::getForTitle( $title ); |
| 508 | + |
507 | 509 | if ( !is_null( $this->difftotext ) ) { |
508 | | - $engine = new DifferenceEngine( $context ); |
509 | | - $engine->setText( $text, $this->difftotext ); |
| 510 | + $engine = $handler->getDifferenceEngine( $context ); |
| 511 | + $engine->setText( $text, $this->difftotext ); #FIXME: use content object! |
510 | 512 | } else { |
511 | | - $engine = new DifferenceEngine( $context, $revision->getID(), $this->diffto ); |
| 513 | + $engine = $handler->getDifferenceEngine( $context, $revision->getID(), $this->diffto ); |
512 | 514 | $vals['diff']['from'] = $engine->getOldid(); |
513 | 515 | $vals['diff']['to'] = $engine->getNewid(); |
514 | 516 | } |