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
Merge "Convert SpecialPrefixIndex to class HTMLForm"
[lhc/web/wiklou.git]
/
includes
/
specials
/
SpecialRedirect.php
diff --git
a/includes/specials/SpecialRedirect.php
b/includes/specials/SpecialRedirect.php
index
1d1df6a
..
36e7779
100644
(file)
--- a/
includes/specials/SpecialRedirect.php
+++ b/
includes/specials/SpecialRedirect.php
@@
-33,16
+33,18
@@
class SpecialRedirect extends FormSpecialPage {
/**
* The type of the redirect (user/file/revision)
*
/**
* The type of the redirect (user/file/revision)
*
+ * Example value: `'user'`
+ *
* @var string $mType
* @var string $mType
- * @example 'user'
*/
protected $mType;
/**
* The identifier/value for the redirect (which id, which file)
*
*/
protected $mType;
/**
* The identifier/value for the redirect (which id, which file)
*
+ * Example value: `'42'`
+ *
* @var string $mValue
* @var string $mValue
- * @example '42'
*/
protected $mValue;
*/
protected $mValue;
@@
-175,11
+177,13
@@
class SpecialRedirect extends FormSpecialPage {
return null;
}
return null;
}
+ $logQuery = ActorMigration::newMigration()->getJoin( 'log_user' );
+
$logparams = [
$logparams = [
- 'log_id',
- 'log_timestamp',
- 'log_type',
- 'log_user_text',
+ 'log_id'
=> 'log_id'
,
+ 'log_timestamp'
=> 'log_timestamp'
,
+ 'log_type'
=> 'log_type'
,
+ 'log_user_text'
=> $logQuery['fields']['log_user_text']
,
];
$dbr = wfGetDB( DB_REPLICA );
];
$dbr = wfGetDB( DB_REPLICA );
@@
-195,9
+199,12
@@
class SpecialRedirect extends FormSpecialPage {
// Returns all fields mentioned in $logparams of the logs
// with the same timestamp as the one returned by the statement above
$logsSameTimestamps = $dbr->select(
// Returns all fields mentioned in $logparams of the logs
// with the same timestamp as the one returned by the statement above
$logsSameTimestamps = $dbr->select(
-
'logging'
,
+
[ 'logging' ] + $logQuery['tables']
,
$logparams,
$logparams,
- [ "log_timestamp = ($inner)" ]
+ [ "log_timestamp = ($inner)" ],
+ __METHOD__,
+ [],
+ $logQuery['joins']
);
if ( $logsSameTimestamps->numRows() === 0 ) {
return null;
);
if ( $logsSameTimestamps->numRows() === 0 ) {
return null;
@@
-215,10
+222,10
@@
class SpecialRedirect extends FormSpecialPage {
// Stores all the rows with the same values in each column
// as $rowMain
// Stores all the rows with the same values in each column
// as $rowMain
- foreach ( $logparams as $
cond
) {
+ foreach ( $logparams as $
key => $dummy
) {
$matchedRows = [];
foreach ( $logsSameTimestamps as $row ) {
$matchedRows = [];
foreach ( $logsSameTimestamps as $row ) {
- if ( $row->$
cond === $rowMain->$cond
) {
+ if ( $row->$
key === $rowMain->$key
) {
$matchedRows[] = $row;
}
}
$matchedRows[] = $row;
}
}
@@
-236,7
+243,7
@@
class SpecialRedirect extends FormSpecialPage {
'log_user_text' => 'user'
];
'log_user_text' => 'user'
];
- foreach ( $logparams as $logKey ) {
+ foreach ( $logparams as $logKey
=> $dummy
) {
$query[$keys[$logKey]] = $matchedRows[0]->$logKey;
}
$query['offset'] = $query['offset'] + 1;
$query[$keys[$logKey]] = $matchedRows[0]->$logKey;
}
$query['offset'] = $query['offset'] + 1;