From: jenkins-bot Date: Thu, 8 Oct 2015 15:51:12 +0000 (+0000) Subject: Merge "Handle edge case in WikiPage::lock()" X-Git-Tag: 1.31.0-rc.0~9475 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dcompta/comptes/journal.php?a=commitdiff_plain;h=15ae9066c58d097ef3181c0e3bd568af444677a5;p=lhc%2Fweb%2Fwiklou.git Merge "Handle edge case in WikiPage::lock()" --- 15ae9066c58d097ef3181c0e3bd568af444677a5 diff --cc includes/page/WikiPage.php index aebd62345f,5f3a59e962..d656bad195 --- a/includes/page/WikiPage.php +++ b/includes/page/WikiPage.php @@@ -2797,15 -2787,11 +2799,12 @@@ class WikiPage implements Page, IDBAcce // WikiPage::READ_LOCKING as that will carry over the FOR UPDATE to // the revisions queries (which also JOIN on user). Only lock the page // row and CAS check on page_latest to see if the trx snapshot matches. - $latest = $this->lock(); - - $this->loadPageData( WikiPage::READ_LATEST ); - $id = $this->getID(); - if ( $id == 0 || $this->getLatest() != $latest ) { + $lockedLatest = $this->lock(); + if ( $id == 0 || $this->getLatest() != $lockedLatest ) { // Page not there or trx snapshot is stale $dbw->rollback( __METHOD__ ); - $status->error( 'cannotdelete', wfEscapeWikiText( $this->getTitle()->getPrefixedText() ) ); + $status->error( 'cannotdelete', + wfEscapeWikiText( $this->getTitle()->getPrefixedText() ) ); return $status; } }