* (bug 26885) Allow show/hide of account blocks, temporary blocks and single IP
address blocks for list=blocks.
* (bug 30591) Add support to only return keys in ApiAllMessages.
+* The API now respects $wgShowHostnames and won't share the hostname in
+ severedby if it's set to false
=== Languages updated in 1.19 ===
* @return string
*/
protected function substituteResultWithError( $e ) {
+ global $wgShowHostnames;
+
$result = $this->getResult();
// Printer may not be initialized if the extractRequestParams() fails for the main module
if ( !isset ( $this->mPrinter ) ) {
if ( !is_null( $requestid ) ) {
$result->addValue( null, 'requestid', $requestid );
}
- // servedby is especially useful when debugging errors
- $result->addValue( null, 'servedby', wfHostName() );
+
+ if ( $wgShowHostnames ) {
+ // servedby is especially useful when debugging errors
+ $result->addValue( null, 'servedby', wfHostName() );
+ }
+
$result->addValue( null, 'error', $errMessage );
return $errMessage['code'];
* @return array
*/
protected function setupExecuteAction() {
+ global $wgShowHostnames;
+
// First add the id to the top element
$result = $this->getResult();
$requestid = $this->getParameter( 'requestid' );
if ( !is_null( $requestid ) ) {
$result->addValue( null, 'requestid', $requestid );
}
- // TODO: Isn't there a setting to disable sharing the server hostname?
- $servedby = $this->getParameter( 'servedby' );
- if ( $servedby ) {
- $result->addValue( null, 'servedby', wfHostName() );
+
+ if ( $wgShowHostnames ) {
+ $servedby = $this->getParameter( 'servedby' );
+ if ( $servedby ) {
+ $result->addValue( null, 'servedby', wfHostName() );
+ }
}
$params = $this->extractRequestParams();