]> git.mjollnir.org Git - moodle.git/commitdiff
merged fixed a warning
authortoyomoyo <toyomoyo>
Fri, 24 Nov 2006 02:04:48 +0000 (02:04 +0000)
committertoyomoyo <toyomoyo>
Fri, 24 Nov 2006 02:04:48 +0000 (02:04 +0000)
lib/blocklib.php

index 6189dc15b83df735efd6b9c5af3f829aecbaee0a..29ec3ec6aadd00ceabd95cae7b7a81b26a6b3eb2 100644 (file)
@@ -168,18 +168,18 @@ function blocks_remove_inappropriate($page) {
 }
 
 function blocks_name_allowed_in_format($name, $pageformat) {
-    $formats = block_method_result($name, 'applicable_formats');
+    
     $accept  = NULL;
     $depth   = -1;
-    if (isset($formats)) {
+    if ($formats = block_method_result($name, 'applicable_formats')) {
         foreach($formats as $format => $allowed) {
             $thisformat = '^'.str_replace('*', '[^-]*', $format).'.*$';
             if(ereg($thisformat, $pageformat)) {
                 if(($scount = substr_count($format, '-')) > $depth) {
                     $depth  = $scount;
                     $accept = $allowed;
-               }
-           }
+                }
+            }
         }
     }
     if($accept === NULL) {