$cs = new CheckStorage;
$fix = isset( $options['fix'] );
- if ( isset( $args[0] ) ) {
- $xml = $args[0];
- } else {
- $xml = false;
- }
+ $xml = $args[0] ?? false;
$cs->check( $fix, $xml );
}
foreach ( $res as $row ) {
$this->oldIdMap[$row->rev_id] = $row->rev_text_id;
}
- $dbr->freeResult( $res );
if ( !count( $this->oldIdMap ) ) {
continue;
$this->addError( 'unfixable', "Error: invalid flags field \"$flags\"", $id );
}
}
- $dbr->freeResult( $res );
// Output errors for any missing text rows
foreach ( $missingTextRows as $oldId => $revId ) {
$externalNormalBlobs[$cluster][$id][] = $row->old_id;
}
}
- $dbr->freeResult( $res );
}
// Check external concat blobs for the right header
foreach ( $res as $row ) {
unset( $xBlobIds[$row->blob_id] );
}
- $extDb->freeResult( $res );
// Print errors for missing blobs rows
foreach ( $xBlobIds as $blobId => $oldId ) {
$this->addError(
case 'historyblobcurstub':
if ( strlen( $row->header ) == $headerLength ) {
$this->addError( 'unfixable', "Error: overlong stub header", $oldId );
- continue;
+ break;
}
$stubObj = unserialize( $row->header );
if ( !is_object( $stubObj ) ) {
$this->addError( 'restore text', "Error: unable to unserialize stub object", $oldId );
- continue;
+ break;
}
if ( $className == 'historyblobstub' ) {
$concatBlobs[$stubObj->mOldId][] = $oldId;
$this->addError( 'unfixable', "Error: unrecognised object class \"$className\"", $oldId );
}
}
- $dbr->freeResult( $res );
}
// Check local concat blob validity
unset( $concatBlobs[$row->old_id] );
}
- $dbr->freeResult( $res );
}
// Check targets of unresolved stubs
}
unset( $oldIds[$row->blob_id] );
}
- $extDb->freeResult( $res );
// Print errors for missing blobs rows
foreach ( $oldIds as $blobId => $oldIds2 ) {