summaryrefslogtreecommitdiff
path: root/includes/revisiondelete/RevDelLogItem.php
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2016-05-01 15:32:59 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2016-05-01 15:32:59 -0400
commit6dc1997577fab2c366781fd7048144935afa0012 (patch)
tree8918d28c7ab4342f0738985e37af1dfc42d0e93a /includes/revisiondelete/RevDelLogItem.php
parent150f94f051128f367bc89f6b7e5f57eb2a69fc62 (diff)
parentfa89acd685cb09cdbe1c64cbb721ec64975bbbc1 (diff)
Merge commit 'fa89acd'
# Conflicts: # .gitignore # extensions/ArchInterWiki.sql
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() {