Merge "Set READ_LATEST for Revision query."

This commit is contained in:
Demon 2012-10-04 16:23:57 +00:00 committed by Gerrit Code Review
commit 32673fcd64

View file

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