From 2d9b71818f61262237fc46110c229d864e265a86 Mon Sep 17 00:00:00 2001 From: umherirrender Date: Sun, 26 May 2013 20:48:17 +0200 Subject: [PATCH] ApiHelp: Avoid header for example, when there no examples When writing a new extension the source: public function getExamples() { return array( //TODO ); } would produce a empty "Example:" header on the help page. Avoid this, by changing the condition to check for truthy instead of false and empty string. Change-Id: I67ecacbbac66b97ed96412abf79b49aebe0ebdbf --- includes/api/ApiBase.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/api/ApiBase.php b/includes/api/ApiBase.php index 7e7365fbc9..c8b05e84de 100644 --- a/includes/api/ApiBase.php +++ b/includes/api/ApiBase.php @@ -304,7 +304,7 @@ abstract class ApiBase extends ContextSource { } $examples = $this->getExamples(); - if ( $examples !== false && $examples !== '' ) { + if ( $examples ) { if ( !is_array( $examples ) ) { $examples = array( $examples -- 2.20.1