return array();
}
- if ( strpos( $code, '/' ) === false ) {
- $txt = MessageCache::singleton()->get( 'Conversiontable', true, $code );
- if ( $txt === false ) {
- # @todo FIXME: This method doesn't seem to be expecting
- # this possible outcome...
- $txt = '<Conversiontable>';
- }
+ $parsed[$key] = true;
+
+ if ( $subpage === '' ) {
+ $txt = MessageCache::singleton()->get( 'conversiontable', true, $code );
} else {
- $title = Title::makeTitleSafe(
- NS_MEDIAWIKI,
- "Conversiontable/$code"
- );
+ $txt = false;
+ $title = Title::makeTitleSafe( NS_MEDIAWIKI, $key );
if ( $title && $title->exists() ) {
- $article = new Article( $title );
- $txt = $article->getContents();
- } else {
- $txt = '';
+ $revision = Revision::newFromTitle( $title );
+ if ( $revision ) {
+ $txt = $revision->getRawText();
+ }
}
}
+ # Nothing to parse if there's no text
+ if ( $txt === false || $txt === null || $txt === '' ) {
+ return array();
+ }
+
// get all subpage links of the form
// [[MediaWiki:Conversiontable/zh-xx/...|...]]
$linkhead = $this->mLangObj->getNsText( NS_MEDIAWIKI ) .
$ret[trim( $m[0] )] = trim( $tt[0] );
}
}
- $parsed[$key] = true;
// recursively parse the subpages
if ( $recursive ) {