* (bug 31644) GlobalUsage, CentralAuth and AbuseLog extensions should not use
insecure links to foreign wikis in the WikiMap.
* (bug 36073) Avoid duplicate element IDs on File pages
+* (bug 25095) Special:Categories should also include the first relevant item
+ when "from" is filled.
=== API changes in 1.20 ===
* (bug 34316) Add ability to retrieve maximum upload size from MediaWiki API.
protected $mLastShown, $mFirstShown, $mPastTheEndIndex, $mDefaultQuery, $mNavigationBar;
+ /**
+ * Whether to include the offset in the query
+ */
+ protected $mIncludeOffset = false;
+
/**
* Result object for the query. Warning: seek before use.
*
$this->mLimit = $limit;
}
+ /**
+ * 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
+ * offset is user-supplied this might be wanted.
+ *
+ * @param $include bool
+ */
+ public function setIncludeOffset( $include ) {
+ $this->mIncludeOffset = $include;
+ }
+
/**
* Extract some useful data from the result object for use by
* the navigation bar, put it into $this
$sortColumns = array_merge( array( $this->mIndexField ), $this->mExtraSortFields );
if ( $descending ) {
$options['ORDER BY'] = $sortColumns;
- $operator = '>';
+ $operator = $this->mIncludeOffset ? '>=' : '>';
} else {
$orderBy = array();
foreach ( $sortColumns as $col ) {
$orderBy[] = $col . ' DESC';
}
$options['ORDER BY'] = $orderBy;
- $operator = '<';
+ $operator = $this->mIncludeOffset ? '<=' : '<';
}
if ( $offset != '' ) {
$conds[] = $this->mIndexField . $operator . $this->mDb->addQuotes( $offset );
$from = str_replace( ' ', '_', $from );
if( $from !== '' ) {
$from = Title::capitalize( $from, NS_CATEGORY );
- $this->mOffset = $from;
+ $this->setOffset( $from );
+ $this->setIncludeOffset( true );
}
}