summaryrefslogtreecommitdiff
path: root/includes/revisiondelete/RevDelLogItem.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/revisiondelete/RevDelLogItem.php')
-rw-r--r--includes/revisiondelete/RevDelLogItem.php27
1 files changed, 17 insertions, 10 deletions
diff --git a/includes/revisiondelete/RevDelLogItem.php b/includes/revisiondelete/RevDelLogItem.php
index 49adf204..65b03097 100644
--- a/includes/revisiondelete/RevDelLogItem.php
+++ b/includes/revisiondelete/RevDelLogItem.php
@@ -48,11 +48,26 @@ class RevDelLogItem extends RevDelItem {
}
public function getBits() {
- return $this->row->log_deleted;
+ return (int)$this->row->log_deleted;
}
public function setBits( $bits ) {
$dbw = wfGetDB( DB_MASTER );
+
+ $dbw->update( 'logging',
+ array( 'log_deleted' => $bits ),
+ array(
+ 'log_id' => $this->row->log_id,
+ 'log_deleted' => $this->getBits() // cas
+ ),
+ __METHOD__
+ );
+
+ if ( !$dbw->affectedRows() ) {
+ // Concurrent fail!
+ return false;
+ }
+
$dbw->update( 'recentchanges',
array(
'rc_deleted' => $bits,
@@ -64,16 +79,8 @@ class RevDelLogItem extends RevDelItem {
),
__METHOD__
);
- $dbw->update( 'logging',
- array( 'log_deleted' => $bits ),
- array(
- 'log_id' => $this->row->log_id,
- 'log_deleted' => $this->getBits()
- ),
- __METHOD__
- );
- return (bool)$dbw->affectedRows();
+ return true;
}
public function getHTML() {