From: jenkins-bot Date: Thu, 18 Feb 2016 14:31:18 +0000 (+0000) Subject: Merge "Avoid master queries in Title::getLinksFrom()" X-Git-Tag: 1.31.0-rc.0~7919 X-Git-Url: http://git.cyclocoop.org//%27%40script%40/%27?a=commitdiff_plain;h=58cb1f824ac75c3b58ba19d1e88c1b38f9dc1fab;p=lhc%2Fweb%2Fwiklou.git Merge "Avoid master queries in Title::getLinksFrom()" --- 58cb1f824ac75c3b58ba19d1e88c1b38f9dc1fab diff --cc includes/Title.php index 38ee2eeca4,a962ea6415..90ac89ced8 --- a/includes/Title.php +++ b/includes/Title.php @@@ -3434,10 -3427,10 +3434,10 @@@ class Title implements LinkTarget * WARNING: do not use this function on arbitrary user-supplied titles! * On heavily-used templates it will max out the memory. * - * @param array $options May be FOR UPDATE + * @param array $options Query option to Database::select() * @return Title[] Array of Title the Title objects linking here */ - public function getTemplateLinksTo( $options = array() ) { + public function getTemplateLinksTo( $options = [] ) { return $this->getLinksTo( $options, 'templatelinks', 'tl' ); } @@@ -3458,14 -3451,10 +3458,10 @@@ # If the page doesn't exist; there can't be any link from this page if ( !$id ) { - return array(); + return []; } - if ( count( $options ) > 0 ) { - $db = wfGetDB( DB_MASTER ); - } else { - $db = wfGetDB( DB_SLAVE ); - } + $db = wfGetDB( DB_SLAVE ); $blNamespace = "{$prefix}_namespace"; $blTitle = "{$prefix}_title";