From ee04d754edc9193219e8dfd07a870229e1a8a6c0 Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Fri, 3 Sep 2010 22:58:09 +0000 Subject: [PATCH] Only display Examples section if it's got anything in the array --- includes/api/ApiBase.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/includes/api/ApiBase.php b/includes/api/ApiBase.php index ce3992a81b..5e8025fb7f 100644 --- a/includes/api/ApiBase.php +++ b/includes/api/ApiBase.php @@ -254,8 +254,11 @@ abstract class ApiBase { $examples ); } - $msg .= 'Example' . ( count( $examples ) > 1 ? 's' : '' ) . ":\n "; - $msg .= implode( $lnPrfx, $examples ) . "\n"; + + if ( count( $examples ) > 0 ) { + $msg .= 'Example' . ( count( $examples ) > 1 ? 's' : '' ) . ":\n "; + $msg .= implode( $lnPrfx, $examples ) . "\n"; + } } if ( $this->getMain()->getShowVersions() ) { -- 2.20.1