Skip to content

Commit

Permalink
Just a little bit more reobust in the face of badly-behaved blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
moodler committed Jan 18, 2005
1 parent 221a853 commit 7933cc6
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/blocklib.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,15 @@ function blocks_delete_instance($instance) {
// by reference for speed; the array is actually not modified.
function blocks_have_content(&$instances) {
foreach($instances as $instance) {
if(!$instance->visible) {
if (!$instance->visible) {
continue;
}
if (!$record = blocks_get_record($instance->blockid)) {
continue;
}
if (!$obj = block_instance($record->name, $instance)) {
continue;
}
$record = blocks_get_record($instance->blockid);
$obj = block_instance($record->name, $instance);
$content = $obj->get_content();
$type = $obj->get_content_type();
switch($type) {
Expand Down

0 comments on commit 7933cc6

Please sign in to comment.