dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix expires typo in comment
[lhc/web/wiklou.git]
/
includes
/
api
/
ApiQueryIWLinks.php
diff --git
a/includes/api/ApiQueryIWLinks.php
b/includes/api/ApiQueryIWLinks.php
index
bb388cd
..
a185ee2
100644
(file)
--- a/
includes/api/ApiQueryIWLinks.php
+++ b/
includes/api/ApiQueryIWLinks.php
@@
-42,11
+42,19
@@
class ApiQueryIWLinks extends ApiQueryBase {
}
$params = $this->extractRequestParams();
}
$params = $this->extractRequestParams();
+ $prop = array_flip( (array)$params['prop'] );
if ( isset( $params['title'] ) && !isset( $params['prefix'] ) ) {
$this->dieUsageMsg( array( 'missingparam', 'prefix' ) );
}
if ( isset( $params['title'] ) && !isset( $params['prefix'] ) ) {
$this->dieUsageMsg( array( 'missingparam', 'prefix' ) );
}
+ // Handle deprecated param
+ $this->requireMaxOneParameter( $params, 'url', 'prop' );
+ if ( $params['url'] ) {
+ $this->logFeatureUsage( 'prop=iwlinks&iwurl' );
+ $prop = array( 'url' => 1 );
+ }
+
$this->addFields( array(
'iwl_from',
'iwl_prefix',
$this->addFields( array(
'iwl_from',
'iwl_prefix',
@@
-114,7
+122,7
@@
class ApiQueryIWLinks extends ApiQueryBase {
}
$entry = array( 'prefix' => $row->iwl_prefix );
}
$entry = array( 'prefix' => $row->iwl_prefix );
- if (
$params['url']
) {
+ if (
isset( $prop['url'] )
) {
$title = Title::newFromText( "{$row->iwl_prefix}:{$row->iwl_title}" );
if ( $title ) {
$entry['url'] = wfExpandUrl( $title->getFullURL(), PROTO_CURRENT );
$title = Title::newFromText( "{$row->iwl_prefix}:{$row->iwl_title}" );
if ( $title ) {
$entry['url'] = wfExpandUrl( $title->getFullURL(), PROTO_CURRENT );
@@
-139,7
+147,16
@@
class ApiQueryIWLinks extends ApiQueryBase {
public function getAllowedParams() {
return array(
public function getAllowedParams() {
return array(
- 'url' => false,
+ 'url' => array(
+ ApiBase::PARAM_DFLT => false,
+ ApiBase::PARAM_DEPRECATED => true,
+ ),
+ 'prop' => array(
+ ApiBase::PARAM_ISMULTI => true,
+ ApiBase::PARAM_TYPE => array(
+ 'url',
+ )
+ ),
'limit' => array(
ApiBase::PARAM_DFLT => 10,
ApiBase::PARAM_TYPE => 'limit',
'limit' => array(
ApiBase::PARAM_DFLT => 10,
ApiBase::PARAM_TYPE => 'limit',
@@
-162,7
+179,11
@@
class ApiQueryIWLinks extends ApiQueryBase {
public function getParamDescription() {
return array(
public function getParamDescription() {
return array(
- 'url' => 'Whether to get the full URL',
+ 'prop' => array(
+ 'Which additional properties to get for each interlanguage link',
+ ' url - Adds the full URL',
+ ),
+ 'url' => "Whether to get the full URL (Cannot be used with {$this->getModulePrefix()}prop)",
'limit' => 'How many interwiki links to return',
'continue' => 'When more results are available, use this to continue',
'prefix' => 'Prefix for the interwiki',
'limit' => 'How many interwiki links to return',
'continue' => 'When more results are available, use this to continue',
'prefix' => 'Prefix for the interwiki',