merged fixed a warning

This commit is contained in:
toyomoyo
2006-11-24 02:04:48 +00:00
parent 5259d5d8dd
commit c5d883fcfb
+4 -4
View 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) {