From: daniel Date: Fri, 9 Jan 2015 14:18:14 +0000 (+0000) Subject: Check $wgAjaxEditStash before using cached edits. X-Git-Tag: 1.31.0-rc.0~12737 X-Git-Url: http://git.cyclocoop.org/%24action?a=commitdiff_plain;h=213c71b55e8f670137f57eaa1486b4b36d5b2a49;p=lhc%2Fweb%2Fwiklou.git Check $wgAjaxEditStash before using cached edits. Without this, stale data from the cache may still be used even after $wgAjaxEditStash was disabled. This is important mainly during testing, when a reliable way to toggle stashing is needed to investigate issues that may be related to the stashing mechanism. Change-Id: Ib9ff68b43763e3857d1a28e34b48439d78c1ed5c --- diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php index fa54f7cbec..0eeab1cffa 100644 --- a/includes/page/WikiPage.php +++ b/includes/page/WikiPage.php @@ -2041,7 +2041,7 @@ class WikiPage implements Page, IDBAccessObject { public function prepareContentForEdit( Content $content, $revid = null, User $user = null, $serialFormat = null, $useCache = true ) { - global $wgContLang, $wgUser; + global $wgContLang, $wgUser, $wgAjaxEditStash; $user = is_null( $user ) ? $wgUser : $user; //XXX: check $user->getId() here??? @@ -2063,7 +2063,7 @@ class WikiPage implements Page, IDBAccessObject { } // The edit may have already been prepared via api.php?action=stashedit - $cachedEdit = $useCache + $cachedEdit = $useCache && $wgAjaxEditStash ? ApiStashEdit::checkCache( $this->getTitle(), $content, $user ) : false;