http://www.mediawiki.org/wiki/Special:Code/MediaWiki/75678

Revision: 75678
Author:   reedy
Date:     2010-10-29 21:36:49 +0000 (Fri, 29 Oct 2010)
Log Message:
-----------
Can only use continue in a loop

Modified Paths:
--------------
    trunk/extensions/Gadgets/Gadgets.php

Modified: trunk/extensions/Gadgets/Gadgets.php
===================================================================
--- trunk/extensions/Gadgets/Gadgets.php        2010-10-29 21:30:20 UTC (rev 
75677)
+++ trunk/extensions/Gadgets/Gadgets.php        2010-10-29 21:36:49 UTC (rev 
75678)
@@ -48,7 +48,9 @@
 function wfLoadGadgets() {
        static $gadgets = null;
 
-       if ( $gadgets !== null ) return $gadgets;
+       if ( $gadgets !== null ) {
+               return $gadgets;
+       }
 
        $struct = wfLoadGadgetsStructured();
        if ( !$struct ) {
@@ -57,7 +59,7 @@
        }
 
        $gadgets = array();
-       foreach ( $struct as $section => $entries ) {
+       foreach ( $struct as $entries ) {
                $gadgets = array_merge( $gadgets, $entries );
        }
 
@@ -68,7 +70,9 @@
        global $wgMemc;
 
        static $gadgets = null;
-       if ( $gadgets !== null && $forceNewText === null ) return $gadgets;
+       if ( $gadgets !== null && $forceNewText === null ) {
+               return $gadgets;
+       }
 
        $key = wfMemcKey( 'gadgets-definition' );
 
@@ -120,7 +124,9 @@
 
 function wfGadgetsGetPreferences( $user, &$preferences ) {
        $gadgets = wfLoadGadgetsStructured();
-       if (!$gadgets) return true;
+       if (!$gadgets) {
+               return true;
+       }
        
        $options = array();
        foreach( $gadgets as $section => $thisSection ) {
@@ -162,7 +168,9 @@
 
 function wfGadgetsBeforePageDisplay( $out ) {
        global $wgUser;
-       if ( !$wgUser->isLoggedIn() ) return true;
+       if ( !$wgUser->isLoggedIn() ) {
+               return true;
+       }
 
        //disable all gadgets on critical special pages
        //NOTE: $out->isUserJsAllowed() is tempting, but always fals if 
$wgAllowUserJs is false.
@@ -177,7 +185,9 @@
        }
 
        $gadgets = wfLoadGadgets();
-       if ( !$gadgets ) return true;
+       if ( !$gadgets ) {
+               return true;
+       }
 
        $lb = new LinkBatch();
        $lb->setCaller( __METHOD__ );
@@ -197,7 +207,9 @@
 
        $done = array();
        foreach ( $pages as $page ) {
-               if ( isset( $done[$page] ) ) continue;
+               if ( isset( $done[$page] ) ) {
+                       continue;
+               }
                $done[$page] = true;
                wfApplyGadgetCode( $page, $out );
        }
@@ -212,7 +224,9 @@
        //       but we'd want it to appear above explicit user stuff, so it 
can be overwritten.
 
        $t = Title::makeTitleSafe( NS_MEDIAWIKI, "Gadget-$page" );
-       if ( !$t ) continue;
+       if ( !$t ) {
+               return;
+       }
 
        if ( preg_match( '/\.js/', $page ) ) {
                $u = $t->getLocalURL( 'action=raw&ctype=' . $wgJsMimeType );


_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to