wfDeprecated( "\$wgExternalDiffEngine = '{$wgExternalDiffEngine}'", '1.27' );
$wgExternalDiffEngine = false;
} elseif ( $wgExternalDiffEngine == 'wikidiff2' ) {
- // Same as above, but with no deprecation warnings
+ wfDeprecated( "\$wgExternalDiffEngine = '{$wgExternalDiffEngine}'", '1.32' );
$wgExternalDiffEngine = false;
} elseif ( !is_string( $wgExternalDiffEngine ) && $wgExternalDiffEngine !== false ) {
// And prevent people from shooting themselves in the foot...
* @return bool|string
*/
protected function textDiff( $otext, $ntext ) {
- global $wgContLang;
-
$otext = str_replace( "\r\n", "\n", $otext );
$ntext = str_replace( "\r\n", "\n", $ntext );
}
# Native PHP diff
- $ota = explode( "\n", $wgContLang->segmentForDiff( $otext ) );
- $nta = explode( "\n", $wgContLang->segmentForDiff( $ntext ) );
+ $contLang = MediaWikiServices::getInstance()->getContentLanguage();
+ $ota = explode( "\n", $contLang->segmentForDiff( $otext ) );
+ $nta = explode( "\n", $contLang->segmentForDiff( $ntext ) );
$diffs = new Diff( $ota, $nta );
$formatter = new TableDiffFormatter();
- $difftext = $wgContLang->unsegmentForDiff( $formatter->format( $diffs ) );
+ $difftext = $contLang->unsegmentForDiff( $formatter->format( $diffs ) );
$difftext .= $this->debug( 'native PHP' );
return $difftext;