<?php
/**
- *
- *
- * Created on May 13, 2007
- *
* Copyright © 2006 Yuri Astrakhan "<Firstname><Lastname>@gmail.com"
*
* This program is free software; you can redistribute it and/or modify
$this->addTables( 'categorylinks' );
$this->addWhereFld( 'cl_from', array_keys( $this->getPageSet()->getGoodTitles() ) );
- if ( !is_null( $params['categories'] ) ) {
+ if ( $params['categories'] ) {
$cats = [];
foreach ( $params['categories'] as $cat ) {
$title = Title::newFromText( $cat );
$cats[] = $title->getDBkey();
}
}
+ if ( !$cats ) {
+ // No titles so no results
+ return;
+ }
$this->addWhereFld( 'cl_to', $cats );
}
$cont = explode( '|', $params['continue'] );
$this->dieContinueUsageIf( count( $cont ) != 2 );
$op = $params['dir'] == 'descending' ? '<' : '>';
- $clfrom = intval( $cont[0] );
+ $clfrom = (int)$cont[0];
$clto = $this->getDB()->addQuotes( $cont[1] );
$this->addWhere(
"cl_from $op $clfrom OR " .