$this->mTimestamp = wfTimestamp( TS_MW, $row->ipb_timestamp );
$this->mAuto = $row->ipb_auto;
$this->mHideName = $row->ipb_deleted;
- $this->mId = $row->ipb_id;
+ $this->mId = (int)$row->ipb_id;
$this->mParentBlockId = $row->ipb_parent_block_id;
// I wish I didn't have to do this
}
$data = array(
- 'userid' => $row->user_id,
+ 'userid' => (int)$row->user_id,
'name' => $row->user_name,
);
if ( $fld_blockinfo && !is_null( $row->ipb_by_text ) ) {
- $data['blockid'] = $row->ipb_id;
+ $data['blockid'] = (int)$row->ipb_id;
$data['blockedby'] = $row->ipb_by_text;
- $data['blockedbyid'] = $row->ipb_by;
+ $data['blockedbyid'] = (int)$row->ipb_by;
$data['blockedtimestamp'] = wfTimestamp( TS_ISO_8601, $row->ipb_timestamp );
$data['blockreason'] = $row->ipb_reason;
$data['blockexpiry'] = $row->ipb_expiry;
$vals = array();
if ( $fld_pageid ) {
- $vals['pageid'] = $row->page_id;
+ $vals['pageid'] = (int)$row->page_id;
}
if ( $fld_title ) {
ApiQueryBase::addTitleInfo( $vals,
ApiResult::META_TYPE => 'assoc',
);
if ( $fld_id ) {
- $block['id'] = $row->ipb_id;
+ $block['id'] = (int)$row->ipb_id;
}
if ( $fld_user && !$row->ipb_auto ) {
$block['user'] = $row->ipb_address;
}
if ( $fld_userid && !$row->ipb_auto ) {
- $block['userid'] = $row->ipb_user;
+ $block['userid'] = (int)$row->ipb_user;
}
if ( $fld_by ) {
$block['by'] = $row->ipb_by_text;
}
if ( $fld_byid ) {
- $block['byid'] = $row->ipb_by;
+ $block['byid'] = (int)$row->ipb_by;
}
if ( $fld_timestamp ) {
$block['timestamp'] = wfTimestamp( TS_ISO_8601, $row->ipb_timestamp );
$res = $this->select( __METHOD__ );
foreach ( $res as $row ) {
$fit = $result->addValue( array( 'query', 'pages', $row->page ),
- 'anoncontributors', $row->anons
+ 'anoncontributors', (int)$row->anons
);
if ( !$fit ) {
// This not fitting isn't reasonable, so it probably means that
}
$fit = $this->addPageSubItem( $row->page,
- array( 'userid' => $row->user, 'name' => $row->username ),
+ array( 'userid' => (int)$row->user, 'name' => $row->username ),
'user'
);
if ( !$fit ) {
$rev['user'] = $row->ar_user_text;
}
if ( $fld_userid ) {
- $rev['userid'] = $row->ar_user;
+ $rev['userid'] = (int)$row->ar_user;
}
}
}
}
$file = array();
- $file['id'] = $row->fa_id;
+ $file['id'] = (int)$row->fa_id;
$file['name'] = $row->fa_name;
$title = Title::makeTitle( NS_FILE, $row->fa_name );
self::addTitleInfo( $file, $title );
if ( $fld_user &&
Revision::userCanBitfield( $row->fa_deleted, File::DELETED_USER, $user )
) {
- $file['userid'] = $row->fa_user;
+ $file['userid'] = (int)$row->fa_user;
$file['user'] = $row->fa_user_text;
}
if ( $fld_sha1 ) {
}
if ( isset( $prop['userid'] ) || /*B/C*/isset( $prop['user'] ) ) {
- $vals['userid'] = $row->pt_user;
+ $vals['userid'] = (int)$row->pt_user;
}
if ( isset( $prop['comment'] ) ) {
}
if ( $this->fld_userid ) {
- $vals['userid'] = $row->rc_user;
+ $vals['userid'] = (int)$row->rc_user;
}
if ( !$row->rc_user ) {
}
// Any rows where we can't view the user were filtered out in the query.
- $vals['userid'] = $row->rev_user;
+ $vals['userid'] = (int)$row->rev_user;
$vals['user'] = $row->rev_user_text;
if ( $row->rev_deleted & Revision::DELETED_USER ) {
$vals['userhidden'] = true;
$data[$name]['hidden'] = true;
}
if ( isset( $this->prop['blockinfo'] ) && !is_null( $row->ipb_by_text ) ) {
- $data[$name]['blockid'] = $row->ipb_id;
+ $data[$name]['blockid'] = (int)$row->ipb_id;
$data[$name]['blockedby'] = $row->ipb_by_text;
- $data[$name]['blockedbyid'] = $row->ipb_by;
+ $data[$name]['blockedbyid'] = (int)$row->ipb_by;
$data[$name]['blockedtimestamp'] = wfTimestamp( TS_ISO_8601, $row->ipb_timestamp );
$data[$name]['blockreason'] = $row->ipb_reason;
$data[$name]['blockexpiry'] = $row->ipb_expiry;
}
if ( Revision::userCanBitfield( $row->rc_deleted, Revision::DELETED_USER, $user ) ) {
if ( $this->fld_userid ) {
- $vals['userid'] = $row->rc_user;
+ $vals['userid'] = (int)$row->rc_user;
// for backwards compatibility
- $vals['user'] = $row->rc_user;
+ $vals['user'] = (int)$row->rc_user;
}
if ( $this->fld_user ) {
* @return int
*/
function insertId() {
- return $this->mConn->insert_id;
+ return (int)$this->mConn->insert_id;
}
/**
if ( $type == 'text' ) {
return $this->user_text;
} elseif ( $type == 'id' ) {
- return $this->user;
+ return (int)$this->user;
}
throw new MWException( "Unknown type '$type'." );
}
/**
- * @param string $method
+ * @param string $type
* @return int|null|string
*/
- public function getUser( $method = 'text' ) {
- return isset( $this->mInfo['user'] ) ? strval( $this->mInfo['user'] ) : null;
+ public function getUser( $type = 'text' ) {
+ if ( $type == 'text' ) {
+ return isset( $this->mInfo['user'] ) ? strval( $this->mInfo['user'] ) : null;
+ } elseif ( $type == 'id' ) {
+ return 0; // What makes sense here, for a remote user?
+ }
}
/**
if ( $type == 'text' ) {
return $this->user_text;
} elseif ( $type == 'id' ) {
- return $this->user;
+ return (int)$this->user;
}
}
function getBitDepth() {
$this->load();
- return $this->bits;
+ return (int)$this->bits;
}
/**