From: Sam Reed Date: Tue, 25 May 2010 18:37:55 +0000 (+0000) Subject: Followup to r66873 X-Git-Tag: 1.31.0-rc.0~36726 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/membres/fiche.php?a=commitdiff_plain;h=499f972752289a12282e14e6846fcb4cd0e6642e;p=lhc%2Fweb%2Fwiklou.git Followup to r66873 If title valid, append URL to parse output --- diff --git a/includes/api/ApiParse.php b/includes/api/ApiParse.php index 7a37a320d0..677f60c673 100644 --- a/includes/api/ApiParse.php +++ b/includes/api/ApiParse.php @@ -322,7 +322,13 @@ class ApiParse extends ApiBase { foreach ( $titles as $title => $id ) { $entry = array(); $entry['prefix'] = $prefix; - $this->getResult()->setContent( $entry, Title::makeTitle( $ns, $title )->getFullText() ); + + $title = Title::newFromText( "{$prefix}:{$title}" ); + if ( $title ) { + $entry['url'] = $title->getFullURL(); + } + + $this->getResult()->setContent( $entry, $title->getFullText() ); $result[] = $entry; } }