*/
protected $caller;
- function __construct( $arr = [] ) {
+ /**
+ * LinkBatch constructor.
+ * @param LinkTarget[] $arr Initial items to be added to the batch
+ */
+ public function __construct( $arr = [] ) {
foreach ( $arr as $item ) {
$this->addObj( $item );
}
* @param string $dbkey
*/
public function add( $ns, $dbkey ) {
- if ( $ns < 0 ) {
- return;
+ if ( $ns < 0 || $dbkey === '' ) {
+ return; // T137083
}
if ( !array_key_exists( $ns, $this->data ) ) {
$this->data[$ns] = [];
}
// This is similar to LinkHolderArray::replaceInternal
- $dbr = wfGetDB( DB_SLAVE );
+ $dbr = wfGetDB( DB_REPLICA );
$table = 'page';
$fields = array_merge(
LinkCache::getSelectFields(),