Merge "Make DBAccessBase use DBConnRef, rename $wiki, and hide getLoadBalancer()"
[lhc/web/wiklou.git] / includes / api / ApiQueryCategories.php
index 7b447cb..79347e6 100644 (file)
@@ -86,7 +86,7 @@ class ApiQueryCategories extends ApiQueryGeneratorBase {
                        $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 " .
@@ -127,6 +127,7 @@ class ApiQueryCategories extends ApiQueryGeneratorBase {
                                'cl_to' . $sort
                        ] );
                }
+               $this->addOption( 'LIMIT', $params['limit'] + 1 );
 
                $res = $this->select( __METHOD__ );