/**
* Replace <!--LINK--> link placeholders with actual links, in the buffer
*
- * @param string $text
+ * @param string &$text
*/
public function replace( &$text ) {
-
$this->replaceInternal( $text );
$this->replaceInterwiki( $text );
-
}
/**
* Replace internal links
- * @param string $text
+ * @param string &$text
*/
protected function replaceInternal( &$text ) {
if ( !$this->internals ) {
$output = $this->parent->getOutput();
$linkRenderer = $this->parent->getLinkRenderer();
- $dbr = wfGetDB( DB_SLAVE );
+ $dbr = wfGetDB( DB_REPLICA );
# Sort by namespace
ksort( $this->internals );
$replacer->cb(),
$text
);
-
}
/**
* Replace interwiki links
- * @param string $text
+ * @param string &$text
*/
protected function replaceInterwiki( &$text ) {
if ( empty( $this->interwikis ) ) {
/**
* Modify $this->internals and $colours according to language variant linking rules
- * @param array $colours
+ * @param array &$colours
*/
protected function doVariants( &$colours ) {
global $wgContLang;
if ( !$linkBatch->isEmpty() ) {
// construct query
- $dbr = wfGetDB( DB_SLAVE );
+ $dbr = wfGetDB( DB_REPLICA );
$fields = array_merge(
LinkCache::getSelectFields(),
[ 'page_namespace', 'page_title' ]
* @return string
*/
public function replaceText( $text ) {
-
$text = preg_replace_callback(
'/<!--(LINK|IWLINK) (.*?)-->/',
- [ &$this, 'replaceTextCallback' ],
+ [ $this, 'replaceTextCallback' ],
$text );
return $text;