dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove a few obscure "done" and "empty" comments
[lhc/web/wiklou.git]
/
includes
/
diff
/
DifferenceEngine.php
diff --git
a/includes/diff/DifferenceEngine.php
b/includes/diff/DifferenceEngine.php
index
63cc2a8
..
8540756
100644
(file)
--- a/
includes/diff/DifferenceEngine.php
+++ b/
includes/diff/DifferenceEngine.php
@@
-21,8
+21,10
@@
* @ingroup DifferenceEngine
*/
* @ingroup DifferenceEngine
*/
+use MediaWiki\MediaWikiServices;
use MediaWiki\Revision\RevisionRecord;
use MediaWiki\Revision\SlotRecord;
use MediaWiki\Revision\RevisionRecord;
use MediaWiki\Revision\SlotRecord;
+use MediaWiki\Storage\NameTableAccessException;
/**
* DifferenceEngine is responsible for rendering the difference between two revisions as HTML.
/**
* DifferenceEngine is responsible for rendering the difference between two revisions as HTML.
@@
-753,14
+755,14
@@
class DifferenceEngine extends ContextSource {
* or false if no link is needed
*/
protected function getMarkPatrolledLinkInfo() {
* or false if no link is needed
*/
protected function getMarkPatrolledLinkInfo() {
- global $wgUseRCPatrol;
-
$user = $this->getUser();
$user = $this->getUser();
+ $config = $this->getConfig();
// Prepare a change patrol link, if applicable
if (
// Is patrolling enabled and the user allowed to?
// Prepare a change patrol link, if applicable
if (
// Is patrolling enabled and the user allowed to?
- $wgUseRCPatrol && $this->mNewPage && $this->mNewPage->quickUserCan( 'patrol', $user ) &&
+ $config->get( 'UseRCPatrol' ) &&
+ $this->mNewPage && $this->mNewPage->quickUserCan( 'patrol', $user ) &&
// Only do this if the revision isn't more than 6 hours older
// than the Max RC age (6h because the RC might not be cleaned out regularly)
RecentChange::isInRCLifespan( $this->mNewRev->getTimestamp(), 21600 )
// Only do this if the revision isn't more than 6 hours older
// than the Max RC age (6h because the RC might not be cleaned out regularly)
RecentChange::isInRCLifespan( $this->mNewRev->getTimestamp(), 21600 )
@@
-1334,12
+1336,11
@@
class DifferenceEngine extends ContextSource {
* @return string
*/
protected function debug( $generator = "internal" ) {
* @return string
*/
protected function debug( $generator = "internal" ) {
- global $wgShowHostnames;
if ( !$this->enableDebugComment ) {
return '';
}
$data = [ $generator ];
if ( !$this->enableDebugComment ) {
return '';
}
$data = [ $generator ];
- if ( $
wgShowHostnames
) {
+ if ( $
this->getConfig()->get( 'ShowHostnames' )
) {
$data[] = wfHostname();
}
$data[] = wfTimestamp( TS_DB );
$data[] = wfHostname();
}
$data[] = wfTimestamp( TS_DB );
@@
-1462,7
+1463,7
@@
class DifferenceEngine extends ContextSource {
return self::intermediateEditsMsg( $nEdits, $numUsers, $limit );
}
return self::intermediateEditsMsg( $nEdits, $numUsers, $limit );
}
- return '';
// nothing
+ return '';
}
/**
}
/**
@@
-1797,22
+1798,42
@@
class DifferenceEngine extends ContextSource {
// Load tags information for both revisions
$dbr = wfGetDB( DB_REPLICA );
// Load tags information for both revisions
$dbr = wfGetDB( DB_REPLICA );
+ $changeTagDefStore = MediaWikiServices::getInstance()->getChangeTagDefStore();
if ( $this->mOldid !== false ) {
if ( $this->mOldid !== false ) {
- $t
his->mOldTags = $dbr->selectField
(
- '
tag_summary
',
- '
ts_tags
',
- [ '
ts
_rev_id' => $this->mOldid ],
+ $t
agIds = $dbr->selectFieldValues
(
+ '
change_tag
',
+ '
ct_tag_id
',
+ [ '
ct
_rev_id' => $this->mOldid ],
__METHOD__
);
__METHOD__
);
+ $tags = [];
+ foreach ( $tagIds as $tagId ) {
+ try {
+ $tags[] = $changeTagDefStore->getName( (int)$tagId );
+ } catch ( NameTableAccessException $exception ) {
+ continue;
+ }
+ }
+ $this->mOldTags = implode( ',', $tags );
} else {
$this->mOldTags = false;
}
} else {
$this->mOldTags = false;
}
- $this->mNewTags = $dbr->selectField(
- 'tag_summary',
- 'ts_tags',
- [ 'ts_rev_id' => $this->mNewid ],
+
+ $tagIds = $dbr->selectFieldValues(
+ 'change_tag',
+ 'ct_tag_id',
+ [ 'ct_rev_id' => $this->mNewid ],
__METHOD__
);
__METHOD__
);
+ $tags = [];
+ foreach ( $tagIds as $tagId ) {
+ try {
+ $tags[] = $changeTagDefStore->getName( (int)$tagId );
+ } catch ( NameTableAccessException $exception ) {
+ continue;
+ }
+ }
+ $this->mNewTags = implode( ',', $tags );
return true;
}
return true;
}