}
if ( isset( $revisionInfo['contributor']['ip'] ) ) {
$revision->setUserIP( $revisionInfo['contributor']['ip'] );
- }
- if ( isset( $revisionInfo['contributor']['username'] ) ) {
+ } elseif ( isset( $revisionInfo['contributor']['username'] ) ) {
$revision->setUserName( $revisionInfo['contributor']['username'] );
+ } else {
+ $revision->setUserName( 'Unknown user' );
}
$revision->setNoUpdates( $this->mNoUpdates );
$fields = array( 'id', 'ip', 'username' );
$info = array();
+ if ( $this->reader->isEmptyElement ) {
+ return $info;
+ }
while ( $this->reader->read() ) {
if ( $this->reader->nodeType == XMLReader::END_ELEMENT &&
$this->reader->localName == 'contributor' ) {