when "from" is filled.
* (bug 35526) jquery.tablesorter now uses a stable sort.
* (bug 38953) --memory-limit switch not working for runJobs.php.
+* (bug 33037) Make subpage of Special:newfiles control how many files
+ are returned, like in previous versions.
=== API changes in 1.20 ===
* (bug 34316) Add ability to retrieve maximum upload size from MediaWiki API.
# Use consistent behavior for the limit options
$this->mDefaultLimit = intval( $this->getUser()->getOption( 'rclimit' ) );
- list( $this->mLimit, /* $offset */ ) = $this->mRequest->getLimitOffset();
+ if ( !$this->mLimit ) {
+ // Don't override if a subclass calls $this->setLimit() in its constructor.
+ list( $this->mLimit, /* $offset */ ) = $this->mRequest->getLimitOffset();
+ }
$this->mIsBackwards = ( $this->mRequest->getVal( 'dir' ) == 'prev' );
$this->mDb = wfGetDB( DB_SLAVE );
/**
* Set the limit from an other source than the request
*
+ * Verifies limit is between 1 and 5000
+ *
* @param $limit Int|String
*/
function setLimit( $limit ) {
- $this->mLimit = $limit;
+ $limit = (int) $limit;
+ // WebRequest::getLimitOffset() puts a cap of 5000, so do same here.
+ if ( $limit > 5000 ) {
+ $limit = 5000;
+ }
+ if ( $limit > 0 ) {
+ $this->mLimit = $limit;
+ }
}
/**
function __construct( IContextSource $context, $par = null ) {
$this->like = $context->getRequest()->getText( 'like' );
$this->showbots = $context->getRequest()->getBool( 'showbots' , 0 );
+ if ( is_numeric( $par ) ) {
+ $this->setLimit( $par );
+ }
parent::__construct( $context );
}
),
'limit' => array(
'type' => 'hidden',
- 'default' => $this->getRequest()->getText( 'limit' ),
+ 'default' => $this->mLimit,
'name' => 'limit',
),
'offset' => array(