// Bitfields to further suppress the content
if ( $this->suppress ) {
- $bitfield = 0;
- // This should be 15...
- $bitfield |= Revision::DELETED_TEXT;
- $bitfield |= Revision::DELETED_COMMENT;
- $bitfield |= Revision::DELETED_USER;
- $bitfield |= Revision::DELETED_RESTRICTED;
+ $bitfield = Revision::SUPPRESSED_ALL;
} else {
$bitfield = 'oi_deleted';
}
'fa_deleted_timestamp' => $encTimestamp,
'fa_deleted_reason' => $encReason,
'fa_deleted' => $this->suppress ? $bitfield : 0,
-
'fa_name' => 'img_name',
'fa_archive_name' => 'NULL',
'fa_size' => 'img_size',
$content = null;
}
+ $fields = Revision::selectFields();
+ $bitfield = false;
+
// Bitfields to further suppress the content
if ( $suppress ) {
- $bitfield = 0;
- // This should be 15...
- $bitfield |= Revision::DELETED_TEXT;
- $bitfield |= Revision::DELETED_COMMENT;
- $bitfield |= Revision::DELETED_USER;
- $bitfield |= Revision::DELETED_RESTRICTED;
- $deletionFields = [ $dbw->addQuotes( $bitfield ) . ' AS deleted' ];
- } else {
- $deletionFields = [ 'rev_deleted AS deleted' ];
+ $bitfield = Revision::SUPPRESSED_ALL;
+ $fields = array_diff( $fields, [ 'rev_deleted' ] );
}
// For now, shunt the revision data into the archive table.
// the rev_deleted field, which is reserved for this purpose.
// Get all of the page revisions
- $fields = array_diff( Revision::selectFields(), [ 'rev_deleted' ] );
$res = $dbw->select(
'revision',
- array_merge( $fields, $deletionFields ),
+ $fields,
[ 'rev_page' => $id ],
__METHOD__,
'FOR UPDATE'
'ar_flags' => '',
'ar_len' => $row->rev_len,
'ar_page_id' => $id,
- 'ar_deleted' => $row->deleted,
+ 'ar_deleted' => $suppress ? $bitfield : $row->rev_deleted,
'ar_sha1' => $row->rev_sha1,
];
if ( $wgContentHandlerUseDB ) {