From: Sam Reed Date: Fri, 3 Sep 2010 22:58:09 +0000 (+0000) Subject: Only display Examples section if it's got anything in the array X-Git-Tag: 1.31.0-rc.0~35185 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=ee04d754edc9193219e8dfd07a870229e1a8a6c0;p=lhc%2Fweb%2Fwiklou.git Only display Examples section if it's got anything in the array --- 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() ) {