return false;
}
# Get the article text
- $rev = Revision::newFromTitle( $nt );
+ $rev = Revision::newFromTitle( $nt, false, Revision::READ_LATEST );
if( !is_object( $rev ) ){
return false;
}
if ( in_array( 'include_old', $options ) ) {
$old_cmp = '>=';
}
- if ( in_array( 'include_new', $options ) ) {\r
- $new_cmp = '<=';\r
- }\r
- if ( in_array( 'include_both', $options ) ) {\r
- $old_cmp = '>=';\r
+ if ( in_array( 'include_new', $options ) ) {
+ $new_cmp = '<=';
+ }
+ if ( in_array( 'include_both', $options ) ) {
+ $old_cmp = '>=';
$new_cmp = '<=';
}
// No DB query needed if $old and $new are the same or successive revisions:
return ( $old_cmp === '>' && $new_cmp === '<' ) ? 0 : 1;
}
return ( $old->getRawUserText() === $new->getRawUserText() ) ? 1 : 2;
- }\r
+ }
$dbr = wfGetDB( DB_SLAVE );
$res = $dbr->select( 'revision', 'DISTINCT rev_user_text',
array(
if ( $titleObj->isRedirect() ) {
$oldTitle = $titleObj;
- $titles = Title::newFromRedirectArray( Revision::newFromTitle( $oldTitle )->getText( Revision::FOR_THIS_USER ) );
+ $titles = Title::newFromRedirectArray(
+ Revision::newFromTitle(
+ $oldTitle, false, Revision::READ_LATEST
+ )->getText( Revision::FOR_THIS_USER )
+ );
// array_shift( $titles );
$redirValues = array();
if ( !is_null( $params['summary'] ) ) {
$requestArray['wpSummary'] = $params['summary'];
}
-
+
if ( !is_null( $params['sectiontitle'] ) ) {
$requestArray['wpSectionTitle'] = $params['sectiontitle'];
}
}
# Try loading it from the database
- $revision = Revision::newFromTitle( Title::makeTitle( NS_MEDIAWIKI, $title ) );
+ $revision = Revision::newFromTitle(
+ Title::makeTitle( NS_MEDIAWIKI, $title ), false, Revision::READ_LATEST
+ );
if ( $revision ) {
$message = $revision->getText();
if ($message === false) {
return false;
}
- $targetRev = Revision::newFromTitle( $this->title );
+ $targetRev = Revision::newFromTitle( $this->title, false, Revision::READ_LATEST );
if ( !$targetRev ) {
wfDebug( __METHOD__.": target redirect already deleted, ignoring\n" );
return true;
if ( !$title->isCssJsSubpage() && !$title->isCssOrJsPage() ) {
return null;
}
- $revision = Revision::newFromTitle( $title );
+ $revision = Revision::newFromTitle( $title, false, Revision::READ_NORMAL );
if ( !$revision ) {
return null;
}
// We're dealing with a subclass that doesn't have a DB
return array();
}
-
+
$hash = $context->getHash();
if ( isset( $this->titleMtimes[$hash] ) ) {
return $this->titleMtimes[$hash];