dépôts
/
lhc
/
web
/
wiklou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5d69578
)
Add the resolved URL of each langlink to the API's action=parse output
author
Roan Kattouw
<catrope@users.mediawiki.org>
Fri, 28 Jan 2011 01:09:47 +0000
(
01:09
+0000)
committer
Roan Kattouw
<catrope@users.mediawiki.org>
Fri, 28 Jan 2011 01:09:47 +0000
(
01:09
+0000)
includes/api/ApiParse.php
patch
|
blob
|
history
diff --git
a/includes/api/ApiParse.php
b/includes/api/ApiParse.php
index
5500829
..
5c5ff56
100644
(file)
--- a/
includes/api/ApiParse.php
+++ b/
includes/api/ApiParse.php
@@
-324,7
+324,12
@@
class ApiParse extends ApiBase {
foreach ( $links as $link ) {
$entry = array();
$bits = explode( ':', $link, 2 );
+ $title = Title::newFromText( $link );
+
$entry['lang'] = $bits[0];
+ if ( $title ) {
+ $entry['url'] = $title->getFullURL();
+ }
$this->getResult()->setContent( $entry, $bits[1] );
$result[] = $entry;
}