Set READ_LATEST for Revision query.

Change-Id: I3946e2e7bbc7ce1099412dd14b4b38b7f12e7954
This commit is contained in:
Aaron Schulz 2012-09-26 14:15:39 -07:00
parent d62ab9a98c
commit cb4cc4695d

View file

@ -315,8 +315,8 @@ class SimpleCaptcha {
global $wgCaptchaRegexes;
if ( $wgCaptchaRegexes ) {
// Custom regex checks
$oldtext = $this->loadText( $editPage, $section );
// Custom regex checks. Reuse $oldtext if set above.
$oldtext = isset( $oldtext ) ? $oldtext : $this->loadText( $editPage, $section );
foreach ( $wgCaptchaRegexes as $regex ) {
$newMatches = array();
@ -683,7 +683,7 @@ class SimpleCaptcha {
* @access private
*/
function loadText( $editPage, $section ) {
$rev = Revision::newFromTitle( $editPage->mTitle );
$rev = Revision::newFromTitle( $editPage->mTitle, false, Revision::READ_LATEST );
if ( is_null( $rev ) ) {
return "";
} else {