merged fixed a warning
This commit is contained in:
+4
-4
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user