public function &getTitle() {
if( $this->mTitle === false ) {
$this->mTitle = Title::makeTitle( $this->mAttribs['rc_namespace'], $this->mAttribs['rc_title'] );
+ # Make sure the correct page ID is process cached
+ $this->mTitle->resetArticleID( $this->mAttribs['rc_cur_id'] );
}
return $this->mTitle;
}
## If we are using foreign keys, an entry of 0 for the page_id will fail, so use NULL
if( $dbw->cascadingDeletes() and $this->mAttribs['rc_cur_id']==0 ) {
- unset ( $this->mAttribs['rc_cur_id'] );
+ unset( $this->mAttribs['rc_cur_id'] );
}
# Insert new row
$this->mAttribs['rc_timestamp'],
$this->mAttribs['rc_comment'],
$this->mAttribs['rc_minor'],
- $this->mAttribs['rc_last_oldid'] );
+ $this->mAttribs['rc_last_oldid'],
+ $this->mAttribs['rc_deleted'] );
+ }
+ }
+
+ public function notifyRC2UDP() {
+ global $wgRC2UDPAddress, $wgRC2UDPOmitBots;
+ # Notify external application via UDP
+ if( $wgRC2UDPAddress && ( !$this->mAttribs['rc_bot'] || !$wgRC2UDPOmitBots ) ) {
+ self::sendToUDP( $this->getIRCLine() );
}
}
}
/**
- * Remove newlines and carriage returns
+ * Remove newlines, carriage returns and decode html entites
* @param string $line
* @return string
*/
public static function cleanupForIRC( $text ) {
- return str_replace(array("\n", "\r"), array("", ""), $text);
+ return Sanitizer::decodeCharReferences( str_replace( array( "\n", "\r" ), array( "", "" ), $text ) );
}
/**
{
if( !$ip ) {
$ip = wfGetIP();
- if( !$ip ) {
- $ip = '';
- }
+ if( !$ip ) $ip = '';
}
$rc = new RecentChange;
{
if( !$ip ) {
$ip = wfGetIP();
- if( !$ip ) {
- $ip = '';
- }
+ if( !$ip ) $ip = '';
}
$rc = new RecentChange;
public static function notifyMove( $timestamp, &$oldTitle, &$newTitle, &$user, $comment, $ip='', $overRedir = false )
{
global $wgRequest;
-
if( !$ip ) {
$ip = wfGetIP();
- if( !$ip ) {
- $ip = '';
- }
+ if( !$ip ) $ip = '';
}
$rc = new RecentChange;
{
global $wgLogRestrictions;
# Don't add private logs to RC!
- if( isset($wgLogRestrictions[$type]) && !$wgLogRestrictions[$type] == '*' ) {
+ if( isset($wgLogRestrictions[$type]) && $wgLogRestrictions[$type] != '*' ) {
return false;
}
$rc = self::newLogEntry( $timestamp, $title, $user, $actionComment, $ip, $type, $action,
$type, $action, $target, $logComment, $params, $newId=0 )
{
global $wgRequest;
-
if( !$ip ) {
$ip = wfGetIP();
- if( !$ip ) {
- $ip = '';
- }
+ if( !$ip ) $ip = '';
}
$rc = new RecentChange;
return $trail;
}
- protected function getIRCLine() {
+ public function getIRCLine() {
global $wgUseRCPatrol, $wgUseNPPatrol, $wgRC2UDPInterwikiPrefix, $wgLocalInterwiki;
// FIXME: Would be good to replace these 2 extract() calls with something more explicit
$flag = $rc_log_action;
} else {
$comment = self::cleanupForIRC( $rc_comment );
- $flag = ($rc_patrolled ? "" : "!") . ($rc_new ? "N" : "") . ($rc_minor ? "M" : "") . ($rc_bot ? "B" : "");
+ $flag = '';
+ if( !$rc_patrolled && ($wgUseRCPatrol || $rc_new && $wgUseNPPatrol) ) {
+ $flag .= '!';
+ }
+ $flag .= ($rc_new ? "N" : "") . ($rc_minor ? "M" : "") . ($rc_bot ? "B" : "");
}
if ( $wgRC2UDPInterwikiPrefix === true ) {