Merge "Avoid connecting to central database when not necessary"

This commit is contained in:
jenkins-bot 2013-09-18 16:26:39 +00:00 committed by Gerrit Code Review
commit 8c00ae5ac8

View file

@ -242,10 +242,10 @@ class AbuseFilterHooks {
if ( $vars->getVar('global_log_ids') ) {
$log_ids = $vars->getVar('global_log_ids')->toNative();
global $wgAbuseFilterCentralDB;
$fdb = wfGetDB( DB_MASTER, array(), $wgAbuseFilterCentralDB );
if ( count($log_ids) ) {
global $wgAbuseFilterCentralDB;
$fdb = wfGetDB( DB_MASTER, array(), $wgAbuseFilterCentralDB );
$fdb->update( 'abuse_filter_log',
array( 'afl_rev_id' => $revision->getId() ),
array( 'afl_id' => $log_ids, 'afl_wiki' => wfWikiId() ),