/**
  * Extracts from a single sql row the data needed to describe one recent change.
  *
  * @param $row The row from which to extract the data.
  * @return An array mapping strings (descriptors) to their respective string values.
  * @access public
  */
 public function extractRowInfo($row)
 {
     /* If page was moved somewhere, get the title of the move target. */
     $movedToTitle = false;
     if (isset($row->rc_moved_to_title) && $row->rc_moved_to_title !== '') {
         $movedToTitle = Title::makeTitle($row->rc_moved_to_ns, $row->rc_moved_to_title);
     }
     /* Determine the title of the page that has been changed. */
     $title = Title::makeTitle($row->rc_namespace, $row->rc_title);
     /* Our output data. */
     $vals = array();
     $type = intval($row->rc_type);
     /* Determine what kind of change this was. */
     switch ($type) {
         case RC_EDIT:
             $vals['type'] = 'edit';
             break;
         case RC_NEW:
             $vals['type'] = 'new';
             break;
         case RC_MOVE:
             $vals['type'] = 'move';
             break;
         case RC_LOG:
             $vals['type'] = 'log';
             break;
         case RC_MOVE_OVER_REDIRECT:
             $vals['type'] = 'move over redirect';
             break;
         default:
             $vals['type'] = $type;
     }
     /* Create a new entry in the result for the title. */
     if ($this->fld_title) {
         ApiQueryBase::addTitleInfo($vals, $title);
         if ($movedToTitle) {
             ApiQueryBase::addTitleInfo($vals, $movedToTitle, 'new_');
         }
     }
     /* Add ids, such as rcid, pageid, revid, and oldid to the change's info. */
     if ($this->fld_ids) {
         $vals['rcid'] = intval($row->rc_id);
         $vals['pageid'] = intval($row->rc_cur_id);
         $vals['revid'] = intval($row->rc_this_oldid);
         $vals['old_revid'] = intval($row->rc_last_oldid);
     }
     /* Add user data and 'anon' flag, if use is anonymous. */
     if ($this->fld_user || $this->fld_userid) {
         if ($this->fld_user) {
             $vals['user'] = $row->rc_user_text;
         }
         if ($this->fld_userid) {
             $vals['userid'] = $row->rc_user;
         }
         if (!$row->rc_user) {
             $vals['anon'] = '';
         }
     }
     /* Add flags, such as new, minor, bot. */
     if ($this->fld_flags) {
         if ($row->rc_bot) {
             $vals['bot'] = '';
         }
         if ($row->rc_new) {
             $vals['new'] = '';
         }
         if ($row->rc_minor) {
             $vals['minor'] = '';
         }
     }
     /* Add sizes of each revision. (Only available on 1.10+) */
     if ($this->fld_sizes) {
         $vals['oldlen'] = intval($row->rc_old_len);
         $vals['newlen'] = intval($row->rc_new_len);
     }
     /* Add the timestamp. */
     if ($this->fld_timestamp) {
         $vals['timestamp'] = wfTimestamp(TS_ISO_8601, $row->rc_timestamp);
     }
     /* Add edit summary / log summary. */
     if ($this->fld_comment && isset($row->rc_comment)) {
         $vals['comment'] = $row->rc_comment;
     }
     if ($this->fld_parsedcomment && isset($row->rc_comment)) {
         $vals['parsedcomment'] = Linker::formatComment($row->rc_comment, $title);
     }
     if ($this->fld_redirect) {
         if ($row->page_is_redirect) {
             $vals['redirect'] = '';
         }
     }
     /* Add the patrolled flag */
     if ($this->fld_patrolled && $row->rc_patrolled == 1) {
         $vals['patrolled'] = '';
     }
     if ($this->fld_loginfo && $row->rc_type == RC_LOG) {
         $vals['logid'] = intval($row->rc_logid);
         $vals['logtype'] = $row->rc_log_type;
         $vals['logaction'] = $row->rc_log_action;
         ApiQueryLogEvents::addLogParams($this->getResult(), $vals, $row->rc_params, $row->rc_log_action, $row->rc_log_type, $row->rc_timestamp);
     }
     if ($this->fld_tags) {
         if ($row->ts_tags) {
             $tags = explode(',', $row->ts_tags);
             $this->getResult()->setIndexedTagName($tags, 'tag');
             $vals['tags'] = $tags;
         } else {
             $vals['tags'] = array();
         }
     }
     if (!is_null($this->token)) {
         $tokenFunctions = $this->getTokenFunctions();
         foreach ($this->token as $t) {
             $val = call_user_func($tokenFunctions[$t], $row->rc_cur_id, $title, RecentChange::newFromRow($row));
             if ($val === false) {
                 $this->setWarning("Action '{$t}' is not allowed for the current user");
             } else {
                 $vals[$t . 'token'] = $val;
             }
         }
     }
     if ($this->fld_wikiamode) {
         $vals['rc_params'] = $row->rc_params;
     }
     return $vals;
 }
 private function extractRowInfo($row)
 {
     $vals = array();
     $type = intval($row->rc_type);
     /* Determine what kind of change this was. */
     switch ($type) {
         case RC_EDIT:
             $vals['type'] = 'edit';
             break;
         case RC_NEW:
             $vals['type'] = 'new';
             break;
         case RC_MOVE:
             $vals['type'] = 'move';
             break;
         case RC_LOG:
             $vals['type'] = 'log';
             break;
         case RC_EXTERNAL:
             $vals['type'] = 'external';
             break;
         case RC_MOVE_OVER_REDIRECT:
             $vals['type'] = 'move over redirect';
             break;
         default:
             $vals['type'] = $type;
     }
     if ($this->fld_ids) {
         $vals['pageid'] = intval($row->rc_cur_id);
         $vals['revid'] = intval($row->rc_this_oldid);
         $vals['old_revid'] = intval($row->rc_last_oldid);
     }
     $title = Title::makeTitle($row->rc_namespace, $row->rc_title);
     if ($this->fld_title) {
         ApiQueryBase::addTitleInfo($vals, $title);
     }
     if ($this->fld_user || $this->fld_userid) {
         if ($this->fld_userid) {
             $vals['userid'] = $row->rc_user;
             // for backwards compatibility
             $vals['user'] = $row->rc_user;
         }
         if ($this->fld_user) {
             $vals['user'] = $row->rc_user_text;
         }
         if (!$row->rc_user) {
             $vals['anon'] = '';
         }
     }
     if ($this->fld_flags) {
         if ($row->rc_type == RC_NEW) {
             $vals['new'] = '';
         }
         if ($row->rc_minor) {
             $vals['minor'] = '';
         }
         if ($row->rc_bot) {
             $vals['bot'] = '';
         }
     }
     if ($this->fld_patrol && isset($row->rc_patrolled)) {
         $vals['patrolled'] = '';
     }
     if ($this->fld_timestamp) {
         $vals['timestamp'] = wfTimestamp(TS_ISO_8601, $row->rc_timestamp);
     }
     if ($this->fld_sizes) {
         $vals['oldlen'] = intval($row->rc_old_len);
         $vals['newlen'] = intval($row->rc_new_len);
     }
     if ($this->fld_notificationtimestamp) {
         $vals['notificationtimestamp'] = $row->wl_notificationtimestamp == null ? '' : wfTimestamp(TS_ISO_8601, $row->wl_notificationtimestamp);
     }
     if ($this->fld_comment && isset($row->rc_comment)) {
         $vals['comment'] = $row->rc_comment;
     }
     if ($this->fld_parsedcomment && isset($row->rc_comment)) {
         $vals['parsedcomment'] = Linker::formatComment($row->rc_comment, $title);
     }
     if ($this->fld_loginfo && $row->rc_type == RC_LOG) {
         $vals['logid'] = intval($row->rc_logid);
         $vals['logtype'] = $row->rc_log_type;
         $vals['logaction'] = $row->rc_log_action;
         $logEntry = DatabaseLogEntry::newFromRow((array) $row);
         ApiQueryLogEvents::addLogParams($this->getResult(), $vals, $logEntry->getParameters(), $logEntry->getType(), $logEntry->getSubtype(), $logEntry->getTimestamp());
     }
     return $vals;
 }
 /**
  * Extracts from a single sql row the data needed to describe one recent change.
  *
  * @param mixed $row The row from which to extract the data.
  * @return array An array mapping strings (descriptors) to their respective string values.
  * @access public
  */
 public function extractRowInfo($row)
 {
     /* Determine the title of the page that has been changed. */
     $title = Title::makeTitle($row->rc_namespace, $row->rc_title);
     $user = $this->getUser();
     /* Our output data. */
     $vals = array();
     $type = intval($row->rc_type);
     /* Determine what kind of change this was. */
     switch ($type) {
         case RC_EDIT:
             $vals['type'] = 'edit';
             break;
         case RC_NEW:
             $vals['type'] = 'new';
             break;
         case RC_MOVE:
             $vals['type'] = 'move';
             break;
         case RC_LOG:
             $vals['type'] = 'log';
             break;
         case RC_EXTERNAL:
             $vals['type'] = 'external';
             break;
         case RC_MOVE_OVER_REDIRECT:
             $vals['type'] = 'move over redirect';
             break;
         default:
             $vals['type'] = $type;
     }
     $anyHidden = false;
     /* Create a new entry in the result for the title. */
     if ($this->fld_title || $this->fld_ids) {
         if ($type === RC_LOG && $row->rc_deleted & LogPage::DELETED_ACTION) {
             $vals['actionhidden'] = '';
             $anyHidden = true;
         }
         if ($type !== RC_LOG || LogEventsList::userCanBitfield($row->rc_deleted, LogPage::DELETED_ACTION, $user)) {
             if ($this->fld_title) {
                 ApiQueryBase::addTitleInfo($vals, $title);
             }
             if ($this->fld_ids) {
                 $vals['pageid'] = intval($row->rc_cur_id);
                 $vals['revid'] = intval($row->rc_this_oldid);
                 $vals['old_revid'] = intval($row->rc_last_oldid);
             }
         }
     }
     if ($this->fld_ids) {
         $vals['rcid'] = intval($row->rc_id);
     }
     /* Add user data and 'anon' flag, if user is anonymous. */
     if ($this->fld_user || $this->fld_userid) {
         if ($row->rc_deleted & Revision::DELETED_USER) {
             $vals['userhidden'] = '';
             $anyHidden = true;
         }
         if (Revision::userCanBitfield($row->rc_deleted, Revision::DELETED_USER, $user)) {
             if ($this->fld_user) {
                 $vals['user'] = $row->rc_user_text;
             }
             if ($this->fld_userid) {
                 $vals['userid'] = $row->rc_user;
             }
             if (!$row->rc_user) {
                 $vals['anon'] = '';
             }
         }
     }
     /* Add flags, such as new, minor, bot. */
     if ($this->fld_flags) {
         if ($row->rc_bot) {
             $vals['bot'] = '';
         }
         if ($row->rc_type == RC_NEW) {
             $vals['new'] = '';
         }
         if ($row->rc_minor) {
             $vals['minor'] = '';
         }
     }
     /* Add sizes of each revision. (Only available on 1.10+) */
     if ($this->fld_sizes) {
         $vals['oldlen'] = intval($row->rc_old_len);
         $vals['newlen'] = intval($row->rc_new_len);
     }
     /* Add the timestamp. */
     if ($this->fld_timestamp) {
         $vals['timestamp'] = wfTimestamp(TS_ISO_8601, $row->rc_timestamp);
     }
     /* Add edit summary / log summary. */
     if ($this->fld_comment || $this->fld_parsedcomment) {
         if ($row->rc_deleted & Revision::DELETED_COMMENT) {
             $vals['commenthidden'] = '';
             $anyHidden = true;
         }
         if (Revision::userCanBitfield($row->rc_deleted, Revision::DELETED_COMMENT, $user)) {
             if ($this->fld_comment && isset($row->rc_comment)) {
                 $vals['comment'] = $row->rc_comment;
             }
             if ($this->fld_parsedcomment && isset($row->rc_comment)) {
                 $vals['parsedcomment'] = Linker::formatComment($row->rc_comment, $title);
             }
         }
     }
     if ($this->fld_redirect) {
         if ($row->page_is_redirect) {
             $vals['redirect'] = '';
         }
     }
     /* Add the patrolled flag */
     if ($this->fld_patrolled && $row->rc_patrolled == 1) {
         $vals['patrolled'] = '';
     }
     if ($this->fld_patrolled && ChangesList::isUnpatrolled($row, $user)) {
         $vals['unpatrolled'] = '';
     }
     if ($this->fld_loginfo && $row->rc_type == RC_LOG) {
         if ($row->rc_deleted & LogPage::DELETED_ACTION) {
             $vals['actionhidden'] = '';
             $anyHidden = true;
         }
         if (LogEventsList::userCanBitfield($row->rc_deleted, LogPage::DELETED_ACTION, $user)) {
             $vals['logid'] = intval($row->rc_logid);
             $vals['logtype'] = $row->rc_log_type;
             $vals['logaction'] = $row->rc_log_action;
             $logEntry = DatabaseLogEntry::newFromRow((array) $row);
             ApiQueryLogEvents::addLogParams($this->getResult(), $vals, $logEntry->getParameters(), $logEntry->getType(), $logEntry->getSubtype(), $logEntry->getTimestamp());
         }
     }
     if ($this->fld_tags) {
         if ($row->ts_tags) {
             $tags = explode(',', $row->ts_tags);
             $this->getResult()->setIndexedTagName($tags, 'tag');
             $vals['tags'] = $tags;
         } else {
             $vals['tags'] = array();
         }
     }
     if ($this->fld_sha1 && $row->rev_sha1 !== null) {
         if ($row->rev_deleted & Revision::DELETED_TEXT) {
             $vals['sha1hidden'] = '';
             $anyHidden = true;
         }
         if (Revision::userCanBitfield($row->rev_deleted, Revision::DELETED_TEXT, $user)) {
             if ($row->rev_sha1 !== '') {
                 $vals['sha1'] = wfBaseConvert($row->rev_sha1, 36, 16, 40);
             } else {
                 $vals['sha1'] = '';
             }
         }
     }
     if (!is_null($this->token)) {
         $tokenFunctions = $this->getTokenFunctions();
         foreach ($this->token as $t) {
             $val = call_user_func($tokenFunctions[$t], $row->rc_cur_id, $title, RecentChange::newFromRow($row));
             if ($val === false) {
                 $this->setWarning("Action '{$t}' is not allowed for the current user");
             } else {
                 $vals[$t . 'token'] = $val;
             }
         }
     }
     if ($anyHidden && $row->rc_deleted & Revision::DELETED_RESTRICTED) {
         $vals['suppressed'] = '';
     }
     return $vals;
 }
 private function extractRowInfo($row)
 {
     /* Determine the title of the page that has been changed. */
     $title = Title::makeTitle($row->rc_namespace, $row->rc_title);
     $user = $this->getUser();
     /* Our output data. */
     $vals = array();
     $type = intval($row->rc_type);
     /* Determine what kind of change this was. */
     switch ($type) {
         case RC_EDIT:
             $vals['type'] = 'edit';
             break;
         case RC_NEW:
             $vals['type'] = 'new';
             break;
         case RC_MOVE:
             $vals['type'] = 'move';
             break;
         case RC_LOG:
             $vals['type'] = 'log';
             break;
         case RC_EXTERNAL:
             $vals['type'] = 'external';
             break;
         case RC_MOVE_OVER_REDIRECT:
             $vals['type'] = 'move over redirect';
             break;
         default:
             $vals['type'] = $type;
     }
     $anyHidden = false;
     /* Create a new entry in the result for the title. */
     if ($this->fld_title || $this->fld_ids) {
         // These should already have been filtered out of the query, but just in case.
         if ($type === RC_LOG && $row->rc_deleted & LogPage::DELETED_ACTION) {
             $vals['actionhidden'] = '';
             $anyHidden = true;
         }
         if ($type !== RC_LOG || LogEventsList::userCanBitfield($row->rc_deleted, LogPage::DELETED_ACTION, $user)) {
             if ($this->fld_title) {
                 ApiQueryBase::addTitleInfo($vals, $title);
             }
             if ($this->fld_ids) {
                 $vals['pageid'] = intval($row->rc_cur_id);
                 $vals['revid'] = intval($row->rc_this_oldid);
                 $vals['old_revid'] = intval($row->rc_last_oldid);
             }
         }
     }
     /* Add user data and 'anon' flag, if user is anonymous. */
     if ($this->fld_user || $this->fld_userid) {
         if ($row->rc_deleted & Revision::DELETED_USER) {
             $vals['userhidden'] = '';
             $anyHidden = true;
         }
         if (Revision::userCanBitfield($row->rc_deleted, Revision::DELETED_USER, $user)) {
             if ($this->fld_userid) {
                 $vals['userid'] = $row->rc_user;
                 // for backwards compatibility
                 $vals['user'] = $row->rc_user;
             }
             if ($this->fld_user) {
                 $vals['user'] = $row->rc_user_text;
             }
             if (!$row->rc_user) {
                 $vals['anon'] = '';
             }
         }
     }
     /* Add flags, such as new, minor, bot. */
     if ($this->fld_flags) {
         if ($row->rc_bot) {
             $vals['bot'] = '';
         }
         if ($row->rc_type == RC_NEW) {
             $vals['new'] = '';
         }
         if ($row->rc_minor) {
             $vals['minor'] = '';
         }
     }
     /* Add sizes of each revision. (Only available on 1.10+) */
     if ($this->fld_sizes) {
         $vals['oldlen'] = intval($row->rc_old_len);
         $vals['newlen'] = intval($row->rc_new_len);
     }
     /* Add the timestamp. */
     if ($this->fld_timestamp) {
         $vals['timestamp'] = wfTimestamp(TS_ISO_8601, $row->rc_timestamp);
     }
     if ($this->fld_notificationtimestamp) {
         $vals['notificationtimestamp'] = $row->wl_notificationtimestamp == null ? '' : wfTimestamp(TS_ISO_8601, $row->wl_notificationtimestamp);
     }
     /* Add edit summary / log summary. */
     if ($this->fld_comment || $this->fld_parsedcomment) {
         if ($row->rc_deleted & Revision::DELETED_COMMENT) {
             $vals['commenthidden'] = '';
             $anyHidden = true;
         }
         if (Revision::userCanBitfield($row->rc_deleted, Revision::DELETED_COMMENT, $user)) {
             if ($this->fld_comment && isset($row->rc_comment)) {
                 $vals['comment'] = $row->rc_comment;
             }
             if ($this->fld_parsedcomment && isset($row->rc_comment)) {
                 $vals['parsedcomment'] = Linker::formatComment($row->rc_comment, $title);
             }
         }
     }
     /* Add the patrolled flag */
     if ($this->fld_patrol && $row->rc_patrolled == 1) {
         $vals['patrolled'] = '';
     }
     if ($this->fld_patrol && ChangesList::isUnpatrolled($row, $user)) {
         $vals['unpatrolled'] = '';
     }
     if ($this->fld_loginfo && $row->rc_type == RC_LOG) {
         if ($row->rc_deleted & LogPage::DELETED_ACTION) {
             $vals['actionhidden'] = '';
             $anyHidden = true;
         }
         if (LogEventsList::userCanBitfield($row->rc_deleted, LogPage::DELETED_ACTION, $user)) {
             $vals['logid'] = intval($row->rc_logid);
             $vals['logtype'] = $row->rc_log_type;
             $vals['logaction'] = $row->rc_log_action;
             $logEntry = DatabaseLogEntry::newFromRow((array) $row);
             ApiQueryLogEvents::addLogParams($this->getResult(), $vals, $logEntry->getParameters(), $logEntry->getType(), $logEntry->getSubtype(), $logEntry->getTimestamp());
         }
     }
     if ($anyHidden && $row->rc_deleted & Revision::DELETED_RESTRICTED) {
         $vals['suppressed'] = '';
     }
     return $vals;
 }
 private function extractRowInfo($row)
 {
     $vals = array();
     if ($this->fld_ids) {
         $vals['pageid'] = intval($row->rc_cur_id);
         $vals['revid'] = intval($row->rc_this_oldid);
         $vals['old_revid'] = intval($row->rc_last_oldid);
     }
     $title = Title::makeTitle($row->rc_namespace, $row->rc_title);
     if ($this->fld_title) {
         ApiQueryBase::addTitleInfo($vals, $title);
     }
     if ($this->fld_user || $this->fld_userid) {
         if ($this->fld_user) {
             $vals['user'] = $row->rc_user_text;
         }
         if ($this->fld_userid) {
             $vals['user'] = $row->rc_user;
         }
         if (!$row->rc_user) {
             $vals['anon'] = '';
         }
     }
     if ($this->fld_flags) {
         if ($row->rc_type == RC_NEW) {
             $vals['new'] = '';
         }
         if ($row->rc_minor) {
             $vals['minor'] = '';
         }
         if ($row->rc_bot) {
             $vals['bot'] = '';
         }
     }
     if ($this->fld_patrol && isset($row->rc_patrolled)) {
         $vals['patrolled'] = '';
     }
     if ($this->fld_timestamp) {
         $vals['timestamp'] = wfTimestamp(TS_ISO_8601, $row->rc_timestamp);
     }
     if ($this->fld_sizes) {
         $vals['oldlen'] = intval($row->rc_old_len);
         $vals['newlen'] = intval($row->rc_new_len);
     }
     if ($this->fld_notificationtimestamp) {
         $vals['notificationtimestamp'] = $row->wl_notificationtimestamp == null ? '' : wfTimestamp(TS_ISO_8601, $row->wl_notificationtimestamp);
     }
     if ($this->fld_comment && isset($row->rc_comment)) {
         $vals['comment'] = $row->rc_comment;
     }
     if ($this->fld_parsedcomment && isset($row->rc_comment)) {
         $vals['parsedcomment'] = Linker::formatComment($row->rc_comment, $title);
     }
     if ($this->fld_loginfo && $row->rc_type == RC_LOG) {
         $vals['logid'] = intval($row->rc_logid);
         $vals['logtype'] = $row->rc_log_type;
         $vals['logaction'] = $row->rc_log_action;
         $logEntry = DatabaseLogEntry::newFromRow((array) $row);
         ApiQueryLogEvents::addLogParams($this->getResult(), $vals, $logEntry->getParameters(), $logEntry->getType(), $logEntry->getSubtype(), $logEntry->getTimestamp());
     }
     return $vals;
 }
Beispiel #6
0
 public function getApiData(ApiResult $result)
 {
     $logEntry = DatabaseLogEntry::newFromRow($this->row);
     $user = $this->list->getUser();
     $ret = array('id' => $logEntry->getId(), 'type' => $logEntry->getType(), 'action' => $logEntry->getSubtype());
     $ret += $logEntry->isDeleted(LogPage::DELETED_USER) ? array('userhidden' => '') : array();
     $ret += $logEntry->isDeleted(LogPage::DELETED_COMMENT) ? array('commenthidden' => '') : array();
     $ret += $logEntry->isDeleted(LogPage::DELETED_ACTION) ? array('actionhidden' => '') : array();
     if (LogEventsList::userCan($this->row, LogPage::DELETED_ACTION, $user)) {
         ApiQueryLogEvents::addLogParams($result, $ret, $logEntry->getParameters(), $logEntry->getType(), $logEntry->getSubtype(), $logEntry->getTimestamp(), $logEntry->isLegacy());
     }
     if (LogEventsList::userCan($this->row, LogPage::DELETED_USER, $user)) {
         $ret += array('userid' => $this->row->log_user, 'user' => $this->row->log_user_text);
     }
     if (LogEventsList::userCan($this->row, LogPage::DELETED_COMMENT, $user)) {
         $ret += array('comment' => $this->row->log_comment);
     }
     return $ret;
 }
 private function extractRowInfo($row)
 {
     $vals = array();
     if ($this->fld_wikiamode) {
         $vals['rc_params'] = $row->rc_params;
         $type = intval($row->rc_type);
         switch ($type) {
             case RC_EDIT:
                 $vals['type'] = 'edit';
                 break;
             case RC_NEW:
                 $vals['type'] = 'new';
                 break;
             case RC_MOVE:
                 $vals['type'] = 'move';
                 break;
             case RC_LOG:
                 $vals['type'] = 'log';
                 break;
             case RC_MOVE_OVER_REDIRECT:
                 $vals['type'] = 'move over redirect';
                 break;
             default:
                 $vals['type'] = $type;
         }
         if ($row->rc_type == RC_LOG) {
             $vals['logtype'] = $row->rc_log_type;
             $vals['logaction'] = $row->rc_log_action;
         }
         $vals['old_revid'] = $row->rc_last_oldid;
     }
     if ($this->fld_ids) {
         $vals['pageid'] = intval($row->rc_cur_id);
         $vals['revid'] = intval($row->rc_this_oldid);
         $vals['old_revid'] = intval($row->rc_last_oldid);
     }
     $title = Title::makeTitle($row->rc_namespace, $row->rc_title);
     if ($this->fld_title) {
         ApiQueryBase::addTitleInfo($vals, $title);
     }
     if ($this->fld_user || $this->fld_userid) {
         if ($this->fld_user) {
             $vals['user'] = $row->rc_user_text;
         }
         if ($this->fld_userid) {
             $vals['user'] = $row->rc_user;
         }
         if (!$row->rc_user) {
             $vals['anon'] = '';
         }
     }
     if ($this->fld_flags) {
         if ($row->rc_new) {
             $vals['new'] = '';
         }
         if ($row->rc_minor) {
             $vals['minor'] = '';
         }
         if ($row->rc_bot) {
             $vals['bot'] = '';
         }
     }
     if ($this->fld_patrol && isset($row->rc_patrolled)) {
         $vals['patrolled'] = '';
     }
     if ($this->fld_timestamp) {
         $vals['timestamp'] = wfTimestamp(TS_ISO_8601, $row->rc_timestamp);
     }
     if ($this->fld_sizes) {
         $vals['oldlen'] = intval($row->rc_old_len);
         $vals['newlen'] = intval($row->rc_new_len);
     }
     if ($this->fld_notificationtimestamp) {
         $vals['notificationtimestamp'] = $row->wl_notificationtimestamp == null ? '' : wfTimestamp(TS_ISO_8601, $row->wl_notificationtimestamp);
     }
     if ($this->fld_comment && isset($row->rc_comment)) {
         $vals['comment'] = $row->rc_comment;
     }
     if ($this->fld_parsedcomment && isset($row->rc_comment)) {
         $vals['parsedcomment'] = Linker::formatComment($row->rc_comment, $title);
     }
     if ($this->fld_loginfo && $row->rc_type == RC_LOG) {
         $vals['logid'] = intval($row->rc_logid);
         $vals['logtype'] = $row->rc_log_type;
         $vals['logaction'] = $row->rc_log_action;
         ApiQueryLogEvents::addLogParams($this->getResult(), $vals, $row->rc_params, $row->rc_log_type, $row->rc_log_action, $row->rc_timestamp);
     }
     return $vals;
 }