<?php
/**
- *
- *
- * Created on Dec 1, 2007
- *
* Copyright © 2006 Yuri Astrakhan "<Firstname><Lastname>@gmail.com"
*
* This program is free software; you can redistribute it and/or modify
if ( is_null( $params['lang'] ) ) {
$langObj = $this->getLanguage();
} elseif ( !Language::isValidCode( $params['lang'] ) ) {
- $this->dieUsage( 'Invalid language code for parameter lang', 'invalidlang' );
+ $this->dieWithError(
+ [ 'apierror-invalidlang', $this->encodeParamName( 'lang' ) ], 'invalidlang'
+ );
} else {
$langObj = Language::factory( $params['lang'] );
}
if ( !is_null( $params['title'] ) ) {
$title = Title::newFromText( $params['title'] );
if ( !$title || $title->isExternal() ) {
- $this->dieUsageMsg( [ 'invalidtitle', $params['title'] ] );
+ $this->dieWithError( [ 'apierror-invalidtitle', wfEscapeWikiText( $params['title'] ) ] );
}
} else {
$title = Title::newFromText( 'API' );
}
public function getHelpUrls() {
- return 'https://www.mediawiki.org/wiki/API:Allmessages';
+ return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Allmessages';
}
}