ApiHelp: Fix undefined variable warning
authorBrad Jorsch <bjorsch@wikimedia.org>
Sat, 7 Nov 2015 17:55:01 +0000 (12:55 -0500)
committerBrad Jorsch <bjorsch@wikimedia.org>
Sat, 7 Nov 2015 17:55:01 +0000 (12:55 -0500)
Change-Id: I5b2790af9182dd76cd52be284f56e4833ac464c6

includes/api/ApiHelp.php

index db7c149..e587162 100644 (file)
@@ -310,6 +310,7 @@ class ApiHelp extends ApiBase {
                                );
                        }
 
+                       $flags = $module->getHelpFlags();
                        $help['flags'] .= Html::openElement( 'div',
                                array( 'class' => 'apihelp-block apihelp-flags' ) );
                        $msg = $context->msg( 'api-help-flags' );
@@ -319,7 +320,7 @@ class ApiHelp extends ApiBase {
                                );
                        }
                        $help['flags'] .= Html::openElement( 'ul' );
-                       foreach ( $module->getHelpFlags() as $flag ) {
+                       foreach ( $flags as $flag ) {
                                $help['flags'] .= Html::rawElement( 'li', null,
                                        self::wrap( $context->msg( "api-help-flag-$flag" ), "apihelp-flag-$flag" )
                                );