dépôts
/
lhc
/
web
/
wiklou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f0ec6a1
)
Add updateRevisionOn() sanity check for existing pages too
author
Aaron Schulz
<aschulz@wikimedia.org>
Wed, 4 Nov 2015 00:44:52 +0000
(16:44 -0800)
committer
Aaron Schulz
<aschulz@wikimedia.org>
Wed, 4 Nov 2015 00:44:52 +0000
(16:44 -0800)
Change-Id: I4f2fc07b0365183efb431a828d40c557b691b18c
includes/page/WikiPage.php
patch
|
blob
|
history
diff --git
a/includes/page/WikiPage.php
b/includes/page/WikiPage.php
index
ba68e62
..
2d5cb78
100644
(file)
--- a/
includes/page/WikiPage.php
+++ b/
includes/page/WikiPage.php
@@
-1832,7
+1832,10
@@
class WikiPage implements Page, IDBAccessObject {
$revisionId = $revision->insertOn( $dbw );
// Update page_latest and friends to reflect the new revision
- $this->updateRevisionOn( $dbw, $revision, null, $oldIsRedirect );
+ if ( !$this->updateRevisionOn( $dbw, $revision, null, $oldIsRedirect ) ) {
+ $dbw->rollback( __METHOD__ );
+ throw new MWException( "Failed to update page row to use new revision." );
+ }
Hooks::run( 'NewRevisionFromEditComplete',
array( $this, $revision, $baseRevId, $user ) );