X-Git-Url: http://git.cyclocoop.org/%22%20%20.%20generer_url_ecrire%28%22mots_tous%22%29%20.%20%22?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialRedirect.php;h=36e777940e8d99c7fa4f7cb69edef809ccf7bcff;hb=27c61fb1e94da9114314468fd00bcf129ec064b6;hp=3273046f57cf927cc0d10ddf4ae46b1fe3a53871;hpb=0c712ce564e0bd53e28f2581a714ee8cd04b614c;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialRedirect.php b/includes/specials/SpecialRedirect.php index 3273046f57..36e777940e 100644 --- a/includes/specials/SpecialRedirect.php +++ b/includes/specials/SpecialRedirect.php @@ -177,11 +177,13 @@ class SpecialRedirect extends FormSpecialPage { return null; } + $logQuery = ActorMigration::newMigration()->getJoin( 'log_user' ); + $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 ); @@ -197,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( - 'logging', + [ 'logging' ] + $logQuery['tables'], $logparams, - [ "log_timestamp = ($inner)" ] + [ "log_timestamp = ($inner)" ], + __METHOD__, + [], + $logQuery['joins'] ); if ( $logsSameTimestamps->numRows() === 0 ) { return null; @@ -217,10 +222,10 @@ class SpecialRedirect extends FormSpecialPage { // 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 ) { - if ( $row->$cond === $rowMain->$cond ) { + if ( $row->$key === $rowMain->$key ) { $matchedRows[] = $row; } } @@ -238,7 +243,7 @@ class SpecialRedirect extends FormSpecialPage { 'log_user_text' => 'user' ]; - foreach ( $logparams as $logKey ) { + foreach ( $logparams as $logKey => $dummy ) { $query[$keys[$logKey]] = $matchedRows[0]->$logKey; } $query['offset'] = $query['offset'] + 1;