00001 <?php
00002
00044 class RecentChange
00045 {
00046 var $mAttribs = array(), $mExtra = array();
00047 var $mTitle = false, $mMovedToTitle = false;
00048 var $numberofWatchingusers = 0 ; # Dummy to prevent error message in SpecialRecentchangeslinked
00049
00050 # Factory methods
00051
00052 public static function newFromRow( $row ) {
00053 $rc = new RecentChange;
00054 $rc->loadFromRow( $row );
00055 return $rc;
00056 }
00057
00058 public static function newFromCurRow( $row ) {
00059 $rc = new RecentChange;
00060 $rc->loadFromCurRow( $row );
00061 $rc->notificationtimestamp = false;
00062 $rc->numberofWatchingusers = false;
00063 return $rc;
00064 }
00065
00072 public static function newFromId( $rcid ) {
00073 $dbr = wfGetDB( DB_SLAVE );
00074 $res = $dbr->select( 'recentchanges', '*', array( 'rc_id' => $rcid ), __METHOD__ );
00075 if( $res && $dbr->numRows( $res ) > 0 ) {
00076 $row = $dbr->fetchObject( $res );
00077 $dbr->freeResult( $res );
00078 return self::newFromRow( $row );
00079 } else {
00080 return NULL;
00081 }
00082 }
00083
00091 public static function newFromConds( $conds, $fname = false ) {
00092 if( $fname === false )
00093 $fname = __METHOD__;
00094 $dbr = wfGetDB( DB_SLAVE );
00095 $res = $dbr->select(
00096 'recentchanges',
00097 '*',
00098 $conds,
00099 $fname
00100 );
00101 if( $res instanceof ResultWrapper && $res->numRows() > 0 ) {
00102 $row = $res->fetchObject();
00103 $res->free();
00104 return self::newFromRow( $row );
00105 }
00106 return null;
00107 }
00108
00109 # Accessors
00110
00111 public function setAttribs( $attribs ) {
00112 $this->mAttribs = $attribs;
00113 }
00114
00115 public function setExtra( $extra ) {
00116 $this->mExtra = $extra;
00117 }
00118
00119 public function &getTitle() {
00120 if( $this->mTitle === false ) {
00121 $this->mTitle = Title::makeTitle( $this->mAttribs['rc_namespace'], $this->mAttribs['rc_title'] );
00122 }
00123 return $this->mTitle;
00124 }
00125
00126 public function getMovedToTitle() {
00127 if( $this->mMovedToTitle === false ) {
00128 $this->mMovedToTitle = Title::makeTitle( $this->mAttribs['rc_moved_to_ns'],
00129 $this->mAttribs['rc_moved_to_title'] );
00130 }
00131 return $this->mMovedToTitle;
00132 }
00133
00134 # Writes the data in this object to the database
00135 public function save() {
00136 global $wgLocalInterwiki, $wgPutIPinRC, $wgRC2UDPAddress, $wgRC2UDPOmitBots;
00137 $fname = 'RecentChange::save';
00138
00139 $dbw = wfGetDB( DB_MASTER );
00140 if( !is_array($this->mExtra) ) {
00141 $this->mExtra = array();
00142 }
00143 $this->mExtra['lang'] = $wgLocalInterwiki;
00144
00145 if( !$wgPutIPinRC ) {
00146 $this->mAttribs['rc_ip'] = '';
00147 }
00148
00149 # If our database is strict about IP addresses, use NULL instead of an empty string
00150 if( $dbw->strictIPs() and $this->mAttribs['rc_ip'] == '' ) {
00151 unset( $this->mAttribs['rc_ip'] );
00152 }
00153
00154 # Fixup database timestamps
00155 $this->mAttribs['rc_timestamp'] = $dbw->timestamp($this->mAttribs['rc_timestamp']);
00156 $this->mAttribs['rc_cur_time'] = $dbw->timestamp($this->mAttribs['rc_cur_time']);
00157 $this->mAttribs['rc_id'] = $dbw->nextSequenceValue( 'rc_rc_id_seq' );
00158
00159 ## If we are using foreign keys, an entry of 0 for the page_id will fail, so use NULL
00160 if( $dbw->cascadingDeletes() and $this->mAttribs['rc_cur_id']==0 ) {
00161 unset ( $this->mAttribs['rc_cur_id'] );
00162 }
00163
00164 # Insert new row
00165 $dbw->insert( 'recentchanges', $this->mAttribs, $fname );
00166
00167 # Set the ID
00168 $this->mAttribs['rc_id'] = $dbw->insertId();
00169
00170 # Notify extensions
00171 wfRunHooks( 'RecentChange_save', array( &$this ) );
00172
00173 # Notify external application via UDP
00174 if( $wgRC2UDPAddress && ( !$this->mAttribs['rc_bot'] || !$wgRC2UDPOmitBots ) ) {
00175 self::sendToUDP( $this->getIRCLine() );
00176 }
00177
00178 # E-mail notifications
00179 global $wgUseEnotif, $wgShowUpdatedMarker, $wgUser;
00180 if( $wgUseEnotif || $wgShowUpdatedMarker ) {
00181
00182 if( $this->mAttribs['rc_user'] ) {
00183 $editor = ($wgUser->getId() == $this->mAttribs['rc_user']) ?
00184 $wgUser : User::newFromID( $this->mAttribs['rc_user'] );
00185
00186 } else {
00187 $editor = ($wgUser->getName() == $this->mAttribs['rc_user_text']) ?
00188 $wgUser : User::newFromName( $this->mAttribs['rc_user_text'], false );
00189 }
00190 # FIXME: this would be better as an extension hook
00191 $enotif = new EmailNotification();
00192 $title = Title::makeTitle( $this->mAttribs['rc_namespace'], $this->mAttribs['rc_title'] );
00193 $enotif->notifyOnPageChange( $editor, $title,
00194 $this->mAttribs['rc_timestamp'],
00195 $this->mAttribs['rc_comment'],
00196 $this->mAttribs['rc_minor'],
00197 $this->mAttribs['rc_last_oldid'] );
00198 }
00199 }
00200
00201 public function notifyRC2UDP() {
00202 global $wgRC2UDPAddress, $wgRC2UDPOmitBots;
00203 # Notify external application via UDP
00204 if( $wgRC2UDPAddress && ( !$this->mAttribs['rc_bot'] || !$wgRC2UDPOmitBots ) ) {
00205 self::sendToUDP( $this->getIRCLine() );
00206 }
00207 }
00208
00216 public static function sendToUDP( $line, $address = '', $prefix = '' ) {
00217 global $wgRC2UDPAddress, $wgRC2UDPPrefix, $wgRC2UDPPort;
00218 # Assume default for standard RC case
00219 $address = $address ? $address : $wgRC2UDPAddress;
00220 $prefix = $prefix ? $prefix : $wgRC2UDPPrefix;
00221 # Notify external application via UDP
00222 if( $address ) {
00223 $conn = socket_create( AF_INET, SOCK_DGRAM, SOL_UDP );
00224 if( $conn ) {
00225 $line = $prefix . $line;
00226 wfDebug( __METHOD__ . ": sending UDP line: $line\n" );
00227 socket_sendto( $conn, $line, strlen($line), 0, $address, $wgRC2UDPPort );
00228 socket_close( $conn );
00229 return true;
00230 } else {
00231 wfDebug( __METHOD__ . ": failed to create UDP socket\n" );
00232 }
00233 }
00234 return false;
00235 }
00236
00242 public static function cleanupForIRC( $text ) {
00243 return Sanitizer::decodeCharReferences( str_replace( array( "\n", "\r" ), array( "", "" ), $text ) );
00244 }
00245
00253 public static function markPatrolled( $change, $auto = false ) {
00254 $change = $change instanceof RecentChange
00255 ? $change
00256 : RecentChange::newFromId($change);
00257 if( !$change instanceof RecentChange ) {
00258 return null;
00259 }
00260 return $change->doMarkPatrolled( $auto );
00261 }
00262
00270 public function doMarkPatrolled( $auto = false ) {
00271 global $wgUser, $wgUseRCPatrol, $wgUseNPPatrol;
00272 $errors = array();
00273
00274
00275 if( !$wgUseRCPatrol && ( !$wgUseNPPatrol || $this->getAttribute('rc_type') != RC_NEW ) ) {
00276 $errors[] = array('rcpatroldisabled');
00277 }
00278
00279 $right = $auto ? 'autopatrol' : 'patrol';
00280 $errors = array_merge( $errors, $this->getTitle()->getUserPermissionsErrors( $right, $wgUser ) );
00281 if( !wfRunHooks('MarkPatrolled', array($this->getAttribute('rc_id'), &$wgUser, false)) ) {
00282 $errors[] = array('hookaborted');
00283 }
00284
00285
00286 if( $wgUser->getName() == $this->getAttribute('rc_user_text') && !$wgUser->isAllowed('autopatrol') ) {
00287 $errors[] = array('markedaspatrollederror-noautopatrol');
00288 }
00289 if( $errors ) {
00290 return $errors;
00291 }
00292
00293 if( $this->getAttribute('rc_patrolled') ) {
00294 return array();
00295 }
00296
00297 $this->reallyMarkPatrolled();
00298
00299 PatrolLog::record( $this, $auto );
00300 wfRunHooks( 'MarkPatrolledComplete', array($this->getAttribute('rc_id'), &$wgUser, false) );
00301 return array();
00302 }
00303
00308 public function reallyMarkPatrolled() {
00309 $dbw = wfGetDB( DB_MASTER );
00310 $dbw->update(
00311 'recentchanges',
00312 array(
00313 'rc_patrolled' => 1
00314 ),
00315 array(
00316 'rc_id' => $this->getAttribute('rc_id')
00317 ),
00318 __METHOD__
00319 );
00320 return $dbw->affectedRows();
00321 }
00322
00323 # Makes an entry in the database corresponding to an edit
00324 public static function notifyEdit( $timestamp, &$title, $minor, &$user, $comment, $oldId,
00325 $lastTimestamp, $bot, $ip='', $oldSize=0, $newSize=0, $newId=0, $patrol=0 )
00326 {
00327 if( !$ip ) {
00328 $ip = wfGetIP();
00329 if( !$ip ) $ip = '';
00330 }
00331
00332 $rc = new RecentChange;
00333 $rc->mAttribs = array(
00334 'rc_timestamp' => $timestamp,
00335 'rc_cur_time' => $timestamp,
00336 'rc_namespace' => $title->getNamespace(),
00337 'rc_title' => $title->getDBkey(),
00338 'rc_type' => RC_EDIT,
00339 'rc_minor' => $minor ? 1 : 0,
00340 'rc_cur_id' => $title->getArticleID(),
00341 'rc_user' => $user->getId(),
00342 'rc_user_text' => $user->getName(),
00343 'rc_comment' => $comment,
00344 'rc_this_oldid' => $newId,
00345 'rc_last_oldid' => $oldId,
00346 'rc_bot' => $bot ? 1 : 0,
00347 'rc_moved_to_ns' => 0,
00348 'rc_moved_to_title' => '',
00349 'rc_ip' => $ip,
00350 'rc_patrolled' => intval($patrol),
00351 'rc_new' => 0, # obsolete
00352 'rc_old_len' => $oldSize,
00353 'rc_new_len' => $newSize,
00354 'rc_deleted' => 0,
00355 'rc_logid' => 0,
00356 'rc_log_type' => null,
00357 'rc_log_action' => '',
00358 'rc_params' => ''
00359 );
00360
00361 $rc->mExtra = array(
00362 'prefixedDBkey' => $title->getPrefixedDBkey(),
00363 'lastTimestamp' => $lastTimestamp,
00364 'oldSize' => $oldSize,
00365 'newSize' => $newSize,
00366 );
00367 $rc->save();
00368 return $rc;
00369 }
00370
00376 public static function notifyNew( $timestamp, &$title, $minor, &$user, $comment, $bot,
00377 $ip='', $size=0, $newId=0, $patrol=0 )
00378 {
00379 if( !$ip ) {
00380 $ip = wfGetIP();
00381 if( !$ip ) $ip = '';
00382 }
00383
00384 $rc = new RecentChange;
00385 $rc->mAttribs = array(
00386 'rc_timestamp' => $timestamp,
00387 'rc_cur_time' => $timestamp,
00388 'rc_namespace' => $title->getNamespace(),
00389 'rc_title' => $title->getDBkey(),
00390 'rc_type' => RC_NEW,
00391 'rc_minor' => $minor ? 1 : 0,
00392 'rc_cur_id' => $title->getArticleID(),
00393 'rc_user' => $user->getId(),
00394 'rc_user_text' => $user->getName(),
00395 'rc_comment' => $comment,
00396 'rc_this_oldid' => $newId,
00397 'rc_last_oldid' => 0,
00398 'rc_bot' => $bot ? 1 : 0,
00399 'rc_moved_to_ns' => 0,
00400 'rc_moved_to_title' => '',
00401 'rc_ip' => $ip,
00402 'rc_patrolled' => intval($patrol),
00403 'rc_new' => 1, # obsolete
00404 'rc_old_len' => 0,
00405 'rc_new_len' => $size,
00406 'rc_deleted' => 0,
00407 'rc_logid' => 0,
00408 'rc_log_type' => null,
00409 'rc_log_action' => '',
00410 'rc_params' => ''
00411 );
00412
00413 $rc->mExtra = array(
00414 'prefixedDBkey' => $title->getPrefixedDBkey(),
00415 'lastTimestamp' => 0,
00416 'oldSize' => 0,
00417 'newSize' => $size
00418 );
00419 $rc->save();
00420 return $rc;
00421 }
00422
00423 # Makes an entry in the database corresponding to a rename
00424 public static function notifyMove( $timestamp, &$oldTitle, &$newTitle, &$user, $comment, $ip='', $overRedir = false )
00425 {
00426 global $wgRequest;
00427 if( !$ip ) {
00428 $ip = wfGetIP();
00429 if( !$ip ) $ip = '';
00430 }
00431
00432 $rc = new RecentChange;
00433 $rc->mAttribs = array(
00434 'rc_timestamp' => $timestamp,
00435 'rc_cur_time' => $timestamp,
00436 'rc_namespace' => $oldTitle->getNamespace(),
00437 'rc_title' => $oldTitle->getDBkey(),
00438 'rc_type' => $overRedir ? RC_MOVE_OVER_REDIRECT : RC_MOVE,
00439 'rc_minor' => 0,
00440 'rc_cur_id' => $oldTitle->getArticleID(),
00441 'rc_user' => $user->getId(),
00442 'rc_user_text' => $user->getName(),
00443 'rc_comment' => $comment,
00444 'rc_this_oldid' => 0,
00445 'rc_last_oldid' => 0,
00446 'rc_bot' => $user->isAllowed( 'bot' ) ? $wgRequest->getBool( 'bot' , true ) : 0,
00447 'rc_moved_to_ns' => $newTitle->getNamespace(),
00448 'rc_moved_to_title' => $newTitle->getDBkey(),
00449 'rc_ip' => $ip,
00450 'rc_new' => 0, # obsolete
00451 'rc_patrolled' => 1,
00452 'rc_old_len' => NULL,
00453 'rc_new_len' => NULL,
00454 'rc_deleted' => 0,
00455 'rc_logid' => 0, # notifyMove not used anymore
00456 'rc_log_type' => null,
00457 'rc_log_action' => '',
00458 'rc_params' => ''
00459 );
00460
00461 $rc->mExtra = array(
00462 'prefixedDBkey' => $oldTitle->getPrefixedDBkey(),
00463 'lastTimestamp' => 0,
00464 'prefixedMoveTo' => $newTitle->getPrefixedDBkey()
00465 );
00466 $rc->save();
00467 }
00468
00469 public static function notifyMoveToNew( $timestamp, &$oldTitle, &$newTitle, &$user, $comment, $ip='' ) {
00470 RecentChange::notifyMove( $timestamp, $oldTitle, $newTitle, $user, $comment, $ip, false );
00471 }
00472
00473 public static function notifyMoveOverRedirect( $timestamp, &$oldTitle, &$newTitle, &$user, $comment, $ip='' ) {
00474 RecentChange::notifyMove( $timestamp, $oldTitle, $newTitle, $user, $comment, $ip, true );
00475 }
00476
00477 public static function notifyLog( $timestamp, &$title, &$user, $actionComment, $ip='', $type,
00478 $action, $target, $logComment, $params, $newId=0 )
00479 {
00480 global $wgLogRestrictions;
00481 # Don't add private logs to RC!
00482 if( isset($wgLogRestrictions[$type]) && $wgLogRestrictions[$type] != '*' ) {
00483 return false;
00484 }
00485 $rc = self::newLogEntry( $timestamp, $title, $user, $actionComment, $ip, $type, $action,
00486 $target, $logComment, $params, $newId );
00487 $rc->save();
00488 return true;
00489 }
00490
00491 public static function newLogEntry( $timestamp, &$title, &$user, $actionComment, $ip='',
00492 $type, $action, $target, $logComment, $params, $newId=0 )
00493 {
00494 global $wgRequest;
00495 if( !$ip ) {
00496 $ip = wfGetIP();
00497 if( !$ip ) $ip = '';
00498 }
00499
00500 $rc = new RecentChange;
00501 $rc->mAttribs = array(
00502 'rc_timestamp' => $timestamp,
00503 'rc_cur_time' => $timestamp,
00504 'rc_namespace' => $target->getNamespace(),
00505 'rc_title' => $target->getDBkey(),
00506 'rc_type' => RC_LOG,
00507 'rc_minor' => 0,
00508 'rc_cur_id' => $target->getArticleID(),
00509 'rc_user' => $user->getId(),
00510 'rc_user_text' => $user->getName(),
00511 'rc_comment' => $logComment,
00512 'rc_this_oldid' => 0,
00513 'rc_last_oldid' => 0,
00514 'rc_bot' => $user->isAllowed( 'bot' ) ? $wgRequest->getBool( 'bot', true ) : 0,
00515 'rc_moved_to_ns' => 0,
00516 'rc_moved_to_title' => '',
00517 'rc_ip' => $ip,
00518 'rc_patrolled' => 1,
00519 'rc_new' => 0, # obsolete
00520 'rc_old_len' => NULL,
00521 'rc_new_len' => NULL,
00522 'rc_deleted' => 0,
00523 'rc_logid' => $newId,
00524 'rc_log_type' => $type,
00525 'rc_log_action' => $action,
00526 'rc_params' => $params
00527 );
00528 $rc->mExtra = array(
00529 'prefixedDBkey' => $title->getPrefixedDBkey(),
00530 'lastTimestamp' => 0,
00531 'actionComment' => $actionComment,
00532 );
00533 return $rc;
00534 }
00535
00536 # Initialises the members of this object from a mysql row object
00537 public function loadFromRow( $row ) {
00538 $this->mAttribs = get_object_vars( $row );
00539 $this->mAttribs['rc_timestamp'] = wfTimestamp(TS_MW, $this->mAttribs['rc_timestamp']);
00540 $this->mAttribs['rc_deleted'] = $row->rc_deleted;
00541 }
00542
00543 # Makes a pseudo-RC entry from a cur row
00544 public function loadFromCurRow( $row ) {
00545 $this->mAttribs = array(
00546 'rc_timestamp' => wfTimestamp(TS_MW, $row->rev_timestamp),
00547 'rc_cur_time' => $row->rev_timestamp,
00548 'rc_user' => $row->rev_user,
00549 'rc_user_text' => $row->rev_user_text,
00550 'rc_namespace' => $row->page_namespace,
00551 'rc_title' => $row->page_title,
00552 'rc_comment' => $row->rev_comment,
00553 'rc_minor' => $row->rev_minor_edit ? 1 : 0,
00554 'rc_type' => $row->page_is_new ? RC_NEW : RC_EDIT,
00555 'rc_cur_id' => $row->page_id,
00556 'rc_this_oldid' => $row->rev_id,
00557 'rc_last_oldid' => isset($row->rc_last_oldid) ? $row->rc_last_oldid : 0,
00558 'rc_bot' => 0,
00559 'rc_moved_to_ns' => 0,
00560 'rc_moved_to_title' => '',
00561 'rc_ip' => '',
00562 'rc_id' => $row->rc_id,
00563 'rc_patrolled' => $row->rc_patrolled,
00564 'rc_new' => $row->page_is_new, # obsolete
00565 'rc_old_len' => $row->rc_old_len,
00566 'rc_new_len' => $row->rc_new_len,
00567 'rc_params' => isset($row->rc_params) ? $row->rc_params : '',
00568 'rc_log_type' => isset($row->rc_log_type) ? $row->rc_log_type : null,
00569 'rc_log_action' => isset($row->rc_log_action) ? $row->rc_log_action : null,
00570 'rc_log_id' => isset($row->rc_log_id) ? $row->rc_log_id: 0,
00571 'rc_deleted' => $row->rc_deleted
00572 );
00573 }
00574
00581 public function getAttribute( $name ) {
00582 return isset( $this->mAttribs[$name] ) ? $this->mAttribs[$name] : NULL;
00583 }
00584
00589 public function diffLinkTrail( $forceCur ) {
00590 if( $this->mAttribs['rc_type'] == RC_EDIT ) {
00591 $trail = "curid=" . (int)($this->mAttribs['rc_cur_id']) .
00592 "&oldid=" . (int)($this->mAttribs['rc_last_oldid']);
00593 if( $forceCur ) {
00594 $trail .= '&diff=0' ;
00595 } else {
00596 $trail .= '&diff=' . (int)($this->mAttribs['rc_this_oldid']);
00597 }
00598 } else {
00599 $trail = '';
00600 }
00601 return $trail;
00602 }
00603
00604 public function getIRCLine() {
00605 global $wgUseRCPatrol, $wgUseNPPatrol, $wgRC2UDPInterwikiPrefix, $wgLocalInterwiki;
00606
00607
00608
00609 extract($this->mAttribs);
00610 extract($this->mExtra);
00611
00612 if( $rc_type == RC_LOG ) {
00613 $titleObj = Title::newFromText( "Log/$rc_log_type", NS_SPECIAL );
00614 } else {
00615 $titleObj =& $this->getTitle();
00616 }
00617 $title = $titleObj->getPrefixedText();
00618 $title = self::cleanupForIRC( $title );
00619
00620 if( $rc_type == RC_LOG ) {
00621 $url = '';
00622 } else {
00623 if( $rc_type == RC_NEW ) {
00624 $url = "oldid=$rc_this_oldid";
00625 } else {
00626 $url = "diff=$rc_this_oldid&oldid=$rc_last_oldid";
00627 }
00628 if( $wgUseRCPatrol || ($rc_type == RC_NEW && $wgUseNPPatrol) ) {
00629 $url .= "&rcid=$rc_id";
00630 }
00631
00632
00633
00634
00635 $url = preg_replace( '/title=[^&]*&/', '', $titleObj->getInternalURL( $url ) );
00636 }
00637
00638 if( isset( $oldSize ) && isset( $newSize ) ) {
00639 $szdiff = $newSize - $oldSize;
00640 if($szdiff < -500) {
00641 $szdiff = "\002$szdiff\002";
00642 } elseif($szdiff >= 0) {
00643 $szdiff = '+' . $szdiff ;
00644 }
00645 $szdiff = '(' . $szdiff . ')' ;
00646 } else {
00647 $szdiff = '';
00648 }
00649
00650 $user = self::cleanupForIRC( $rc_user_text );
00651
00652 if( $rc_type == RC_LOG ) {
00653 $targetText = $this->getTitle()->getPrefixedText();
00654 $comment = self::cleanupForIRC( str_replace("[[$targetText]]","[[\00302$targetText\00310]]",$actionComment) );
00655 $flag = $rc_log_action;
00656 } else {
00657 $comment = self::cleanupForIRC( $rc_comment );
00658 $flag = '';
00659 if( !$rc_patrolled && ($wgUseRCPatrol || $rc_new && $wgUseNPPatrol) ) {
00660 $flag .= '!';
00661 }
00662 $flag .= ($rc_new ? "N" : "") . ($rc_minor ? "M" : "") . ($rc_bot ? "B" : "");
00663 }
00664
00665 if ( $wgRC2UDPInterwikiPrefix === true ) {
00666 $prefix = $wgLocalInterwiki;
00667 } elseif ( $wgRC2UDPInterwikiPrefix ) {
00668 $prefix = $wgRC2UDPInterwikiPrefix;
00669 } else {
00670 $prefix = false;
00671 }
00672 if ( $prefix !== false ) {
00673 $titleString = "\00314[[\00303$prefix:\00307$title\00314]]";
00674 } else {
00675 $titleString = "\00314[[\00307$title\00314]]";
00676 }
00677
00678 # see http://www.irssi.org/documentation/formats for some colour codes. prefix is \003,
00679 # no colour (\003) switches back to the term default
00680 $fullString = "$titleString\0034 $flag\00310 " .
00681 "\00302$url\003 \0035*\003 \00303$user\003 \0035*\003 $szdiff \00310$comment\003\n";
00682
00683 return $fullString;
00684 }
00685
00690 public function getCharacterDifference( $old = 0, $new = 0 ) {
00691 if( $old === 0 ) {
00692 $old = $this->mAttribs['rc_old_len'];
00693 }
00694 if( $new === 0 ) {
00695 $new = $this->mAttribs['rc_new_len'];
00696 }
00697 if( $old === NULL || $new === NULL ) {
00698 return '';
00699 }
00700 return ChangesList::showCharacterDifference( $old, $new );
00701 }
00702 }