}
}
+ /**
+ * Get the current limit
+ *
+ * @return int
+ */
+ function getLimit() {
+ return $this->mLimit;
+ }
+
/**
* Set whether a row matching exactly the offset should be also included
* in the result or not. By default this is not the case, but when the
public function execute() {
$params = $this->extractRequestParams();
- global $wgFeed, $wgFeedClasses, $wgSitename, $wgLanguageCode;
+ global $wgFeed, $wgFeedClasses, $wgFeedLimit, $wgSitename, $wgLanguageCode;
if ( !$wgFeed ) {
$this->dieUsage( 'Syndication feeds are not available', 'feed-unavailable' );
'showSizeDiff' => $params['showsizediff'],
) );
+ if ( $pager->getLimit() > $wgFeedLimit ) {
+ $pager->setLimit( $wgFeedLimit );
+ }
+
$feedItems = array();
if ( $pager->getNumRows() > 0 ) {
foreach ( $pager->mResult as $row ) {
* @ingroup FileRepo
*/
class LocalRepo extends FileRepo {
- public $oldFileFromRowFactory = array( 'OldLocalFile', 'newFromRow' );
-
protected $fileFactory = array( 'LocalFile', 'newFromTitle' );
protected $fileFactoryKey = array( 'LocalFile', 'newFromKey' );
protected $fileFromRowFactory = array( 'LocalFile', 'newFromRow' );
+ protected $oldFileFromRowFactory = array( 'OldLocalFile', 'newFromRow' );
protected $oldFileFactory = array( 'OldLocalFile', 'newFromTitle' );
protected $oldFileFactoryKey = array( 'OldLocalFile', 'newFromKey' );
$r = array();
foreach ( $res as $row ) {
- if ( $this->repo->oldFileFromRowFactory ) {
- $r[] = call_user_func( $this->repo->oldFileFromRowFactory, $row, $this->repo );
- } else {
- $r[] = OldLocalFile::newFromRow( $row, $this->repo );
- }
+ $r[] = $this->repo->newFileFromRow( $row );
}
if ( $order == 'ASC' ) {