X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiQueryWatchlistRaw.php;h=38b17fcdedd743c387353a45f302d730dc3f28ec;hb=0220b4375c25775c4b0611becd53b78be158cfb9;hp=ce4ce50ffb4ac6ce40754f001a5069730ea093d5;hpb=782fb0e1db555b4e2a68b5653706172b02cf799b;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiQueryWatchlistRaw.php b/includes/api/ApiQueryWatchlistRaw.php index ce4ce50ffb..38b17fcded 100644 --- a/includes/api/ApiQueryWatchlistRaw.php +++ b/includes/api/ApiQueryWatchlistRaw.php @@ -76,12 +76,12 @@ class ApiQueryWatchlistRaw extends ApiQueryGeneratorBase { "original value returned by the previous query", "_badcontinue" ); } $ns = intval( $cont[0] ); - $title = $this->getDB()->strencode( $this->titleToKey( $cont[1] ) ); + $title = $this->getDB()->addQuotes( $cont[1] ); $op = $params['dir'] == 'ascending' ? '>' : '<'; $this->addWhere( - "wl_namespace $op '$ns' OR " . - "(wl_namespace = '$ns' AND " . - "wl_title $op= '$title')" + "wl_namespace $op $ns OR " . + "(wl_namespace = $ns AND " . + "wl_title $op= $title)" ); } @@ -103,8 +103,7 @@ class ApiQueryWatchlistRaw extends ApiQueryGeneratorBase { foreach ( $res as $row ) { if ( ++$count > $params['limit'] ) { // We've reached the one extra which shows that there are additional pages to be had. Stop here... - $this->setContinueEnumParameter( 'continue', $row->wl_namespace . '|' . - $this->keyToTitle( $row->wl_title ) ); + $this->setContinueEnumParameter( 'continue', $row->wl_namespace . '|' . $row->wl_title ); break; } $t = Title::makeTitle( $row->wl_namespace, $row->wl_title ); @@ -118,8 +117,7 @@ class ApiQueryWatchlistRaw extends ApiQueryGeneratorBase { } $fit = $this->getResult()->addValue( $this->getModuleName(), null, $vals ); if ( !$fit ) { - $this->setContinueEnumParameter( 'continue', $row->wl_namespace . '|' . - $this->keyToTitle( $row->wl_title ) ); + $this->setContinueEnumParameter( 'continue', $row->wl_namespace . '|' . $row->wl_title ); break; } } else { @@ -192,6 +190,21 @@ class ApiQueryWatchlistRaw extends ApiQueryGeneratorBase { ); } + public function getResultProperties() { + return array( + '' => array( + 'ns' => 'namespace', + 'title' => 'string' + ), + 'changed' => array( + 'changed' => array( + ApiBase::PROP_TYPE => 'timestamp', + ApiBase::PROP_NULLABLE => true + ) + ) + ); + } + public function getDescription() { return "Get all pages on the logged in user's watchlist"; }